Fix DB problem
This commit is contained in:
parent
dd898d1abe
commit
8538f7b9f2
|
@ -361,8 +361,7 @@ public class DBWriter {
|
|||
adapter.setQueue(queue);
|
||||
EventBus.getDefault().post(new QueueEvent(QueueEvent.Action.ADDED, item, index));
|
||||
if(item.isNew()) {
|
||||
adapter.setFeedItemRead(FeedItem.UNPLAYED, item.getId());
|
||||
EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast();
|
||||
DBWriter.markItemRead(context, false, item.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -427,10 +426,8 @@ public class DBWriter {
|
|||
if (queueModified) {
|
||||
adapter.setQueue(queue);
|
||||
EventBus.getDefault().post(new QueueEvent(QueueEvent.Action.ADDED_ITEMS, queue));
|
||||
Log.d(TAG, "# mark as unplayed: " + markAsUnplayedIds.size());
|
||||
if(markAsUnplayedIds.size() > 0) {
|
||||
adapter.setFeedItemRead(FeedItem.UNPLAYED, markAsUnplayedIds.toArray());
|
||||
EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast();
|
||||
DBWriter.markItemRead(context, false, markAsUnplayedIds.toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -890,10 +890,6 @@ public class PodDBAdapter {
|
|||
}
|
||||
db.setTransactionSuccessful();
|
||||
db.endTransaction();
|
||||
db.execSQL("UPDATE " + TABLE_NAME_FEED_ITEMS
|
||||
+ " SET " + KEY_READ + "=" + FeedItem.UNPLAYED
|
||||
+ " WHERE " + KEY_ID + " IN(" + TextUtils.join(",", Arrays.asList(ids)) + ")"
|
||||
+ " AND " + KEY_READ + "=" + FeedItem.NEW);
|
||||
}
|
||||
|
||||
public void clearQueue() {
|
||||
|
|
Loading…
Reference in New Issue