Moved setQueue into transaction

This commit is contained in:
daniel oeh 2013-04-06 14:14:40 +02:00
parent ab34475b75
commit bab27809c7

View File

@ -441,6 +441,7 @@ public class PodDBAdapter {
public void setQueue(List<FeedItem> queue) {
ContentValues values = new ContentValues();
db.beginTransaction();
db.delete(TABLE_NAME_QUEUE, null, null);
for (int i = 0; i < queue.size(); i++) {
FeedItem item = queue.get(i);
@ -450,6 +451,8 @@ public class PodDBAdapter {
db.insertWithOnConflict(TABLE_NAME_QUEUE, null, values,
SQLiteDatabase.CONFLICT_REPLACE);
}
db.setTransactionSuccessful();
db.endTransaction();
}
public void removeFeedMedia(FeedMedia media) {