summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorTom Hennen <tom.hennen@gmail.com>2015-10-02 07:56:34 -0400
committerTom Hennen <tom.hennen@gmail.com>2015-10-02 07:56:34 -0400
commit0beeeb435153f1fdb11ffe7f89899b76c10f3f3b (patch)
tree1b17bb75bb083d2f293454c514e6702ff9bde97a /core/src
parent60e341cf787eb7fef9c8cf4ce0347117e34771ee (diff)
downloadAntennaPod-0beeeb435153f1fdb11ffe7f89899b76c10f3f3b.zip
resolved bug in how we were choosing the default cleanup parameter
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java7
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/APCleanupAlgorithm.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/APQueueCleanupAlgorithm.java2
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);
}
}