From df45f60cf367088445bef991ce7240cfacadbbe7 Mon Sep 17 00:00:00 2001 From: Christopher Lorenz Date: Mon, 25 Jan 2021 21:35:11 +0100 Subject: [PATCH] Bugfix: Read feed when updating item in database --- .../main/java/de/danoeh/antennapod/core/storage/DBReader.java | 2 +- .../main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 1 + .../main/java/de/danoeh/antennapod/core/sync/SyncService.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 4c1f23474..8673b1f45 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -134,7 +134,7 @@ public final class DBReader { * * @param items The FeedItems whose Feed-objects should be loaded. */ - private static void loadFeedDataOfFeedItemList(List items) { + public static void loadFeedDataOfFeedItemList(List items) { List feeds = getFeedList(); Map feedIndex = new ArrayMap<>(feeds.size()); 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 9e6041df3..67d1779fc 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 @@ -777,6 +777,7 @@ public class DBWriter { adapter.open(); adapter.setFeedItemlist(items); adapter.close(); + EventBus.getDefault().post(FeedItemEvent.updated(items)); }); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java index 0392da4e6..c91b26ff6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java @@ -474,6 +474,7 @@ public class SyncService extends Worker { } } DBWriter.removeQueueItem(getApplicationContext(), false, queueToBeRemoved.toArray()); + DBReader.loadFeedDataOfFeedItemList(updatedItems); DBWriter.setItemList(updatedItems); }