diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index 461488562..3194d7cab 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -47,7 +47,6 @@ import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.event.DownloadEvent; import de.danoeh.antennapod.core.event.DownloaderUpdate; -import de.danoeh.antennapod.core.event.FavoritesEvent; import de.danoeh.antennapod.core.event.FeedItemEvent; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 846afc004..6f299ee35 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -350,7 +350,6 @@ public class DBWriter { itemIds.add(item.getId()); item.addTag(FeedItem.TAG_QUEUE); } - EventBus.getDefault().post(FeedItemEvent.updated(items)); return addQueueItem(context, false, itemIds.toArray()); } @@ -374,6 +373,7 @@ public class DBWriter { boolean queueModified = false; LongList markAsUnplayedIds = new LongList(); List events = new ArrayList<>(); + List updatedItems = new ArrayList<>(); for (int i = 0; i < itemIds.length; i++) { if (!itemListContains(queue, itemIds[i])) { final FeedItem item = DBReader.getFeedItem(itemIds[i]); @@ -389,6 +389,8 @@ public class DBWriter { queue.add(item); events.add(QueueEvent.added(item, queue.size() - 1)); } + item.addTag(FeedItem.TAG_QUEUE); + updatedItems.add(item); queueModified = true; if (item.isNew()) { markAsUnplayedIds.add(item.getId()); @@ -401,6 +403,7 @@ public class DBWriter { for (QueueEvent event : events) { EventBus.getDefault().post(event); } + EventBus.getDefault().post(FeedItemEvent.updated(updatedItems)); if (markAsUnplayedIds.size() > 0) { DBWriter.markItemPlayed(FeedItem.UNPLAYED, markAsUnplayedIds.toArray()); }