diff options
-rw-r--r-- | app/src/main/res/xml/preferences.xml | 6 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 5175acdcb..dedfb74c3 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -35,6 +35,12 @@ android:key="prefFollowQueue" android:summary="@string/pref_followQueue_sum" android:title="@string/pref_followQueue_title"/> + <CheckBoxPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefAutoDelete" + android:summary="Delete epidsode when playback completes" + android:title="Delete On Finish"/> <Preference android:key="prefPlaybackSpeedLauncher" android:summary="@string/pref_playback_speed_sum" 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 a5560e3fb..94e490149 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 @@ -539,6 +539,15 @@ public class PlaybackService extends Service { if (isAutoFlattrable(media) && UserPreferences.getAutoFlattrPlayedDurationThreshold() == 1.0f) { DBTasks.flattrItemIfLoggedIn(PlaybackService.this, item); } + + //Delete episode if enabled + if(UserPreferences.isAutoDelete()) { + DBWriter.deleteFeedMediaOfItem(PlaybackService.this, item.getMedia().getId()); + + if(BuildConfig.DEBUG) + Log.d(TAG, "Episode Deleted"); + } + } // Load next episode if previous episode was in the queue and if there |