Bugfix: Read feed when updating item in database

This commit is contained in:
Christopher Lorenz 2021-01-25 21:35:11 +01:00 committed by ByteHamster
parent f0b86c18a8
commit df45f60cf3
3 changed files with 3 additions and 1 deletions

View File

@ -134,7 +134,7 @@ public final class DBReader {
* *
* @param items The FeedItems whose Feed-objects should be loaded. * @param items The FeedItems whose Feed-objects should be loaded.
*/ */
private static void loadFeedDataOfFeedItemList(List<FeedItem> items) { public static void loadFeedDataOfFeedItemList(List<FeedItem> items) {
List<Feed> feeds = getFeedList(); List<Feed> feeds = getFeedList();
Map<Long, Feed> feedIndex = new ArrayMap<>(feeds.size()); Map<Long, Feed> feedIndex = new ArrayMap<>(feeds.size());

View File

@ -777,6 +777,7 @@ public class DBWriter {
adapter.open(); adapter.open();
adapter.setFeedItemlist(items); adapter.setFeedItemlist(items);
adapter.close(); adapter.close();
EventBus.getDefault().post(FeedItemEvent.updated(items));
}); });
} }

View File

@ -474,6 +474,7 @@ public class SyncService extends Worker {
} }
} }
DBWriter.removeQueueItem(getApplicationContext(), false, queueToBeRemoved.toArray()); DBWriter.removeQueueItem(getApplicationContext(), false, queueToBeRemoved.toArray());
DBReader.loadFeedDataOfFeedItemList(updatedItems);
DBWriter.setItemList(updatedItems); DBWriter.setItemList(updatedItems);
} }