fix +1 updates and re-implement playlist sorting

This commit is contained in:
Adrian Ulrich committed 2016-11-24 13:23:04 +01:00
1 parent 53eb77e8b3
commit 0873318931
3 files changed
+59 -46

No files matched your search

@@ -149,13 +149,12 @@ public class MediaLibraryBackend extends SQLiteOpenHelper {
* @param values the data to set / modify
* @param whereClause the selection
* @param whereArgs arguments to selection
* @param userVisible controls if we shall call notifyObserver() to refresh the UI
* @return the number of affected rows
*/
public int update (String table, ContentValues values, String whereClause, String[] whereArgs, boolean userVisible) {
public int update (String table, ContentValues values, String whereClause, String[] whereArgs) {
SQLiteDatabase dbh = getWritableDatabase();
int res = dbh.update(table, values, whereClause, whereArgs);
if (res > 0 && userVisible == true) {
if (res > 0) {
// Note: we are not running notifyObserver for performance reasons here
// Code which changes relations should just delete + re-insert data
notifyObserver();
@@ -163,6 +162,15 @@ public class MediaLibraryBackend extends SQLiteOpenHelper {
return res;
}
/**
* Wrapper for SQLiteDatabase.execSQL() function
*
* @param sql the raw sql string
*/
public void execSQL(String sql) {
getWritableDatabase().execSQL(sql);
}
/**
* Wrapper for SQLiteDatabase.insert() function
*