diff options
4 files changed, 15 insertions, 1 deletions
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 0f1175ca3..c18838c51 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -136,6 +136,12 @@ android:summary="@string/pref_skip_keeps_episodes_sum" android:title="@string/pref_skip_keeps_episodes_title"/> <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefFavoriteKeepsEpisode" + android:summary="@string/pref_favorite_keeps_episodes_sum" + android:title="@string/pref_favorite_keeps_episodes_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference android:defaultValue="false" android:enabled="true" android:key="prefAutoDelete" 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 042298e28..48492ced9 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 @@ -67,6 +67,7 @@ public class UserPreferences { public static final String PREF_HARDWARE_PREVIOUS_BUTTON_RESTARTS = "prefHardwarePreviousButtonRestarts"; public static final String PREF_FOLLOW_QUEUE = "prefFollowQueue"; public static final String PREF_SKIP_KEEPS_EPISODE = "prefSkipKeepsEpisode"; + public static final String PREF_FAVORITE_KEEPS_EPISODE = "prefFavoriteKeepsEpisode"; public static final String PREF_AUTO_DELETE = "prefAutoDelete"; public static final String PREF_SMART_MARK_AS_PLAYED_SECS = "prefSmartMarkAsPlayedSecs"; public static final String PREF_PLAYBACK_SPEED_ARRAY = "prefPlaybackSpeedArray"; @@ -295,6 +296,10 @@ public class UserPreferences { public static boolean shouldSkipKeepEpisode() { return prefs.getBoolean(PREF_SKIP_KEEPS_EPISODE, true); } + public static boolean shouldFavoriteKeepEpisode() { + return prefs.getBoolean(PREF_FAVORITE_KEEPS_EPISODE, true); + } + public static boolean isAutoDelete() { return prefs.getBoolean(PREF_AUTO_DELETE, false); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 3166dd743..b8ab70ed4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -892,7 +892,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { // isInQueue remains false } // Delete episode if enabled - if (item.getFeed().getPreferences().getCurrentAutoDelete()) { + if (item.getFeed().getPreferences().getCurrentAutoDelete() && + !(item.isTagged(FeedItem.TAG_FAVORITE) && UserPreferences.shouldFavoriteKeepEpisode())) { DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media.getId()); Log.d(TAG, "Episode Deleted"); } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 4506f1acd..38c891d99 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -320,6 +320,8 @@ <string name="pref_smart_mark_as_played_title">Smart Mark as Played</string> <string name="pref_skip_keeps_episodes_sum">Keep episodes when they are skipped</string> <string name="pref_skip_keeps_episodes_title">Keep Skipped Episodes</string> + <string name="pref_favorite_keeps_episodes_sum">Keep episodes when they are marked Favorite</string> + <string name="pref_favorite_keeps_episodes_title">Keep Favorite Episodes</string> <string name="playback_pref">Playback</string> <string name="network_pref">Network</string> <string name="pref_autoUpdateIntervallOrTime_title">Update Interval or Time of Day</string> |