diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-10-02 07:56:34 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-10-02 07:56:34 -0400 |
commit | 0beeeb435153f1fdb11ffe7f89899b76c10f3f3b (patch) | |
tree | 1b17bb75bb083d2f293454c514e6702ff9bde97a /core/src/main/java/de | |
parent | 60e341cf787eb7fef9c8cf4ce0347117e34771ee (diff) | |
download | AntennaPod-0beeeb435153f1fdb11ffe7f89899b76c10f3f3b.zip |
resolved bug in how we were choosing the default cleanup parameter
Diffstat (limited to 'core/src/main/java/de')
3 files changed, 7 insertions, 4 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 1d5bd5031..f706c83ee 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 @@ -98,6 +98,9 @@ public class UserPreferences { // Experimental public static final String PREF_SONIC = "prefSonic"; public static final String PREF_NORMALIZER = "prefNormalizer"; + public static final int EPISODE_CLEANUP_QUEUE = -1; + public static final int EPISODE_CLEANUP_NULL = -2; + public static final int EPISODE_CLEANUP_DEFAULT = 0; // Constants private static int EPISODE_CACHE_SIZE_UNLIMITED = -1; @@ -494,9 +497,9 @@ public class UserPreferences { public static EpisodeCleanupAlgorithm getEpisodeCleanupAlgorithm() { int cleanupValue = prefs.getInt(PREF_EPISODE_CLEANUP, -1); - if (cleanupValue == -1) { + if (cleanupValue == EPISODE_CLEANUP_QUEUE) { return new APQueueCleanupAlgorithm(); - } else if (cleanupValue == -2) { + } else if (cleanupValue == EPISODE_CLEANUP_NULL) { return new APNullCleanupAlgorithm(); } else { return new APCleanupAlgorithm(cleanupValue); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/APCleanupAlgorithm.java b/core/src/main/java/de/danoeh/antennapod/core/storage/APCleanupAlgorithm.java index ef834921a..b4fbdaea1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/APCleanupAlgorithm.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/APCleanupAlgorithm.java @@ -90,6 +90,6 @@ public class APCleanupAlgorithm extends EpisodeCleanupAlgorithm { @Override public int getDefaultCleanupParameter() { - return 0; + return getNumEpisodesToCleanup(0); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/APQueueCleanupAlgorithm.java b/core/src/main/java/de/danoeh/antennapod/core/storage/APQueueCleanupAlgorithm.java index ebf8ca4cf..549b4e02c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/APQueueCleanupAlgorithm.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/APQueueCleanupAlgorithm.java @@ -74,6 +74,6 @@ public class APQueueCleanupAlgorithm extends EpisodeCleanupAlgorithm { @Override public int getDefaultCleanupParameter() { - return 0; + return getNumEpisodesToCleanup(0); } } |