This commit is contained in:
Johannes Mockenhaupt 2018-06-23 02:48:36 +02:00
parent 986d9fb01c
commit 79dec2e871
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
3 changed files with 5 additions and 5 deletions

View file

@ -132,7 +132,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
private void createRowIfNotExists(Dao dao, String table, String name, String type) {
try {
dao.executeRaw("ALTER TABLE `" + table + "` ADD COLUMN `" + name + " " + type);
final String statement = "ALTER TABLE `" + table + "` ADD COLUMN `" + name + "` " + type;
dao.executeRaw(statement);
} catch (SQLException e) {
// row already exists
}

View file

@ -70,7 +70,7 @@ public class SourceNSClientPlugin extends PluginBase implements BgSourceInterfac
bgReading.filtered = sourceDescription != null
&& (sourceDescription.equals("G5 Native") || sourceDescription.equals("AndroidAPS-DexcomG5"));
bgReading.sourcePlugin = getName();
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, "NS");
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());
if (isNew) {
sgvs.add(bgReading);
}

View file

@ -6,7 +6,6 @@ import com.google.common.collect.Lists;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -23,7 +22,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
private static SourceXdripPlugin plugin = null;
public static SourceXdripPlugin getPlugin() {
if (plugin == null)
plugin = new SourceXdripPlugin();
@ -48,7 +47,7 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
String sourceDescription = bundle.getString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, "");
bgReading.filtered = sourceDescription.equals("G5 Native") || sourceDescription.equals("AndroidAPS-DexcomG5");
bgReading.filtered = sourceDescription.equals("G5 Native");
bgReading.sourcePlugin = getName();
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());