diff options
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); } } |