From c64217e2b485f3c6b997a55b1ef910c8b72779d3 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Fri, 26 Jun 2015 02:39:22 +0200 Subject: Add episode action fragment --- .../java/de/danoeh/antennapod/core/storage/DBWriter.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'core/src/main/java/de') 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 feeee48c5..7d60746e1 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 @@ -375,14 +375,21 @@ public class DBWriter { } + public static Future addQueueItem(final Context context, + final long... itemIds) { + return addQueueItem(context, false, itemIds); + } + + /** * Appends FeedItem objects to the end of the queue. The 'read'-attribute of all items will be set to true. * If a FeedItem is already in the queue, the FeedItem will not change its position in the queue. * * @param context A context that is used for opening a database connection. + * @param performAutoDownload true if an auto-download process should be started after the operation. * @param itemIds IDs of the FeedItem objects that should be added to the queue. */ - public static Future addQueueItem(final Context context, + public static Future addQueueItem(final Context context, final boolean performAutoDownload, final long... itemIds) { return dbExec.submit(new Runnable() { @@ -423,11 +430,12 @@ public class DBWriter { } } adapter.close(); - DBTasks.autodownloadUndownloadedItems(context); + if (performAutoDownload) { + DBTasks.autodownloadUndownloadedItems(context); + } } } }); - } /** -- cgit v1.2.3