diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2017-04-09 20:26:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 20:26:00 +0200 |
commit | 4d256b7323d5a00b081508b13eb9141ab3aa9035 (patch) | |
tree | 3bd4fbc0598e4c081a4ac349c551f88ef696e588 /core/src/main/java | |
parent | 8864f51f039a66fcca5791912228907079ef4447 (diff) | |
parent | a2e07e749b4274bc20546dcbd73ea690bf25dcb9 (diff) | |
download | AntennaPod-4d256b7323d5a00b081508b13eb9141ab3aa9035.zip |
Merge pull request #2225 from mfietz/issue/2222-not-add-to-queue
Setting whether or not to enqueue downloaded episodes
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 10 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index aa3bbaeab..2221da2e7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -74,6 +74,7 @@ public class UserPreferences { public static final String PREF_RESUME_AFTER_CALL = "prefResumeAfterCall"; // Network + public static final String PREF_ENQUEUE_DOWNLOADED = "prefEnqueueDownloaded"; public static final String PREF_UPDATE_INTERVAL = "prefAutoUpdateIntervall"; public static final String PREF_MOBILE_UPDATE = "prefMobileUpdate"; public static final String PREF_EPISODE_CLEANUP = "prefEpisodeCleanup"; @@ -258,11 +259,10 @@ public class UserPreferences { return prefs.getBoolean(PREF_SHOW_DOWNLOAD_REPORT, true); } - /** - * Returns {@code true} if new queue elements are added to the front - * - * @return {@code true} if new queue elements are added to the front; {@code false} otherwise - */ + public static boolean enqueueDownloadedEpisodes() { + return prefs.getBoolean(PREF_ENQUEUE_DOWNLOADED, true); + } + public static boolean enqueueAtFront() { return prefs.getBoolean(PREF_QUEUE_ADD_TO_FRONT, false); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 87c454964..9ac459394 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -1051,7 +1051,8 @@ public class DownloadService extends Service { DBWriter.setFeedMedia(media).get(); - if (item != null && !DBTasks.isInQueue(DownloadService.this, item.getId())) { + if (item != null && UserPreferences.enqueueDownloadedEpisodes() && + !DBTasks.isInQueue(DownloadService.this, item.getId())) { DBWriter.addQueueItem(DownloadService.this, item).get(); } } catch (ExecutionException | InterruptedException e) { |