diff options
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 19 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 1 |
2 files changed, 18 insertions, 2 deletions
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 7dad9cb08..3b4dfe9a6 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 @@ -583,18 +583,33 @@ public class DBWriter { /* * Sets the 'read'-attribute of all specified FeedItems * - * @param context A context that is used for opening a database connection. * @param played New value of the 'read'-attribute, one of FeedItem.PLAYED, FeedItem.NEW, * FeedItem.UNPLAYED * @param itemIds IDs of the FeedItems. */ public static Future<?> markItemPlayed(final int played, final long... itemIds) { + return markItemPlayed(played, true, itemIds); + } + + /* + * Sets the 'read'-attribute of all specified FeedItems + * + * @param played New value of the 'read'-attribute, one of FeedItem.PLAYED, FeedItem.NEW, + * FeedItem.UNPLAYED + * @param broadcastUpdate true if this operation should trigger a UnreadItemsUpdate broadcast. + * This option is usually set to true + * @param itemIds IDs of the FeedItems. + */ + public static Future<?> markItemPlayed(final int played, final boolean broadcastUpdate, + final long... itemIds) { return dbExec.submit(() -> { final PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setFeedItemRead(played, itemIds); adapter.close(); - EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast(); + if(broadcastUpdate) { + EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast(); + } }); } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 7db689512..5391435b7 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -491,6 +491,7 @@ <string name="gpodnetauth_device_chooseExistingDevice">Choose existing device:</string> <string name="gpodnetauth_device_errorEmpty">Device ID must not be empty</string> <string name="gpodnetauth_device_errorAlreadyUsed">Device ID already in use</string> + <string name="gpodnetauth_device_caption_errorEmpty">Caption must not be empty</string> <string name="gpodnetauth_device_butChoose">Choose</string> <string name="gpodnetauth_finish_title">Login successful!</string> |