Fixes.
This commit is contained in:
parent
986d9fb01c
commit
79dec2e871
3 changed files with 5 additions and 5 deletions
|
@ -132,7 +132,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
|
|
||||||
private void createRowIfNotExists(Dao dao, String table, String name, String type) {
|
private void createRowIfNotExists(Dao dao, String table, String name, String type) {
|
||||||
try {
|
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) {
|
} catch (SQLException e) {
|
||||||
// row already exists
|
// row already exists
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class SourceNSClientPlugin extends PluginBase implements BgSourceInterfac
|
||||||
bgReading.filtered = sourceDescription != null
|
bgReading.filtered = sourceDescription != null
|
||||||
&& (sourceDescription.equals("G5 Native") || sourceDescription.equals("AndroidAPS-DexcomG5"));
|
&& (sourceDescription.equals("G5 Native") || sourceDescription.equals("AndroidAPS-DexcomG5"));
|
||||||
bgReading.sourcePlugin = getName();
|
bgReading.sourcePlugin = getName();
|
||||||
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, "NS");
|
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
sgvs.add(bgReading);
|
sgvs.add(bgReading);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
@ -23,7 +22,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
|
||||||
public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
||||||
|
|
||||||
private static SourceXdripPlugin plugin = null;
|
private static SourceXdripPlugin plugin = null;
|
||||||
|
|
||||||
public static SourceXdripPlugin getPlugin() {
|
public static SourceXdripPlugin getPlugin() {
|
||||||
if (plugin == null)
|
if (plugin == null)
|
||||||
plugin = new SourceXdripPlugin();
|
plugin = new SourceXdripPlugin();
|
||||||
|
@ -48,7 +47,7 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
|
||||||
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
|
bgReading.date = bundle.getLong(Intents.EXTRA_TIMESTAMP);
|
||||||
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
|
bgReading.raw = bundle.getDouble(Intents.EXTRA_RAW);
|
||||||
String sourceDescription = bundle.getString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, "");
|
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();
|
bgReading.sourcePlugin = getName();
|
||||||
|
|
||||||
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());
|
boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, getName());
|
||||||
|
|
Loading…
Reference in a new issue