get rid of mtime=0
Setting mtime=0 was done by older releases and is always wrong, it should be at least '1' Also fixes triggerFullMediaScan() to ditch the correct values ;-)
This commit is contained in:
parent
4c59fc2486
commit
7d9025a967
@ -35,7 +35,7 @@ public class MediaLibraryBackend extends SQLiteOpenHelper {
|
||||
/**
|
||||
* The database version we are using
|
||||
*/
|
||||
private static final int DATABASE_VERSION = 20170120;
|
||||
private static final int DATABASE_VERSION = 20170211;
|
||||
/**
|
||||
* on-disk file to store the database
|
||||
*/
|
||||
|
@ -234,6 +234,12 @@ public class MediaSchema {
|
||||
dbh.execSQL(DATABASE_CREATE_PREFERENCES);
|
||||
triggerFullMediaScan(dbh);
|
||||
}
|
||||
|
||||
if (oldVersion < 20170211) {
|
||||
// older versions of triggerFullMediaScan did this by mistake
|
||||
dbh.execSQL("UPDATE songs SET mtime=1 WHERE mtime=0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -245,7 +251,7 @@ public class MediaSchema {
|
||||
private static void triggerFullMediaScan(SQLiteDatabase dbh) {
|
||||
dbh.execSQL("UPDATE "+MediaLibrary.TABLE_SONGS+" SET "+MediaLibrary.SongColumns.MTIME+"=1");
|
||||
// wipes non-bools only - not nice but good enough for now
|
||||
dbh.execSQL("DELETE FROM "+MediaLibrary.TABLE_PREFERENCES+" WHERE "+MediaLibrary.PreferenceColumns.VALUE+" < 2");
|
||||
dbh.execSQL("DELETE FROM "+MediaLibrary.TABLE_PREFERENCES+" WHERE "+MediaLibrary.PreferenceColumns.VALUE+" > 1");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user