summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/de/danoeh/antennapod/feed/FeedManager.java39
-rw-r--r--src/de/danoeh/antennapod/preferences/PlaybackPreferences.java27
2 files changed, 0 insertions, 66 deletions
diff --git a/src/de/danoeh/antennapod/feed/FeedManager.java b/src/de/danoeh/antennapod/feed/FeedManager.java
index 19b4a0375..ed72f0d47 100644
--- a/src/de/danoeh/antennapod/feed/FeedManager.java
+++ b/src/de/danoeh/antennapod/feed/FeedManager.java
@@ -726,7 +726,6 @@ public class FeedManager {
public void removeQueueItem(final Context context, FeedItem item) {
boolean removed = queue.remove(item);
if (removed) {
- autoDeleteIfPossible(context, item.getMedia());
dbExec.execute(new Runnable() {
@Override
@@ -743,44 +742,6 @@ public class FeedManager {
}
/**
- * Delete the episode of this FeedMedia object if auto-delete is enabled and
- * it is not the last played media or it is the last played media and
- * playback has been completed.
- */
- public void autoDeleteIfPossible(Context context, FeedMedia media) {
- if (media != null) {
- SharedPreferences prefs = PreferenceManager
- .getDefaultSharedPreferences(context
- .getApplicationContext());
- if (UserPreferences.isAutoDelete()) {
-
- if (!media.isPlaying()
- && ((media.getId() != PlaybackPreferences
- .getAutoDeleteMediaId()) || (media.getId() == PlaybackPreferences
- .getAutoDeleteMediaId() && PlaybackPreferences
- .isAutoDeleteMediaPlaybackCompleted()))) {
- if (AppConfig.DEBUG)
- Log.d(TAG, "Performing auto-cleanup");
- deleteFeedMedia(context, media);
-
- SharedPreferences.Editor editor = prefs.edit();
- editor.putLong(
- PlaybackPreferences.PREF_AUTODELETE_MEDIA_ID, -1);
- editor.commit();
- } else {
- if (AppConfig.DEBUG)
- Log.d(TAG, "Didn't do auto-cleanup");
- }
- } else {
- if (AppConfig.DEBUG)
- Log.d(TAG, "Auto-delete preference is disabled");
- }
- } else {
- Log.e(TAG, "Could not do auto-cleanup: media was null");
- }
- }
-
- /**
* Moves the queue item at the specified index to another position. If the
* indices are out of range, no operation will be performed.
*
diff --git a/src/de/danoeh/antennapod/preferences/PlaybackPreferences.java b/src/de/danoeh/antennapod/preferences/PlaybackPreferences.java
index 22462121a..c6a431541 100644
--- a/src/de/danoeh/antennapod/preferences/PlaybackPreferences.java
+++ b/src/de/danoeh/antennapod/preferences/PlaybackPreferences.java
@@ -42,15 +42,6 @@ public class PlaybackPreferences implements
/** True if last played media was a video. */
public static final String PREF_CURRENT_EPISODE_IS_VIDEO = "de.danoeh.antennapod.preferences.lastIsVideo";
- /** True if playback of last played media has been completed. */
- public static final String PREF_AUTO_DELETE_MEDIA_PLAYBACK_COMPLETED = "de.danoeh.antennapod.preferences.lastPlaybackCompleted";
-
- /**
- * ID of the last played media which should be auto-deleted as soon as
- * PREF_LAST_PLAYED_ID changes.
- */
- public static final String PREF_AUTODELETE_MEDIA_ID = "de.danoeh.antennapod.preferences.autoDeleteMediaId";
-
/** Value of PREF_CURRENTLY_PLAYING_MEDIA if no media is playing. */
public static final long NO_MEDIA_PLAYING = -1;
@@ -59,8 +50,6 @@ public class PlaybackPreferences implements
private long currentlyPlayingMedia;
private boolean currentEpisodeIsStream;
private boolean currentEpisodeIsVideo;
- private boolean autoDeleteMediaPlaybackCompleted;
- private long autoDeleteMediaId;
private static PlaybackPreferences instance;
private Context context;
@@ -97,9 +86,6 @@ public class PlaybackPreferences implements
NO_MEDIA_PLAYING);
currentEpisodeIsStream = sp.getBoolean(PREF_CURRENT_EPISODE_IS_STREAM, true);
currentEpisodeIsVideo = sp.getBoolean(PREF_CURRENT_EPISODE_IS_VIDEO, false);
- autoDeleteMediaPlaybackCompleted = sp.getBoolean(
- PREF_AUTO_DELETE_MEDIA_PLAYBACK_COMPLETED, false);
- autoDeleteMediaId = sp.getLong(PREF_AUTODELETE_MEDIA_ID, -1);
}
@Override
@@ -118,11 +104,6 @@ public class PlaybackPreferences implements
} else if (key.equals(PREF_CURRENT_EPISODE_IS_VIDEO)) {
currentEpisodeIsVideo = sp.getBoolean(PREF_CURRENT_EPISODE_IS_VIDEO, false);
- } else if (key.equals(PREF_AUTO_DELETE_MEDIA_PLAYBACK_COMPLETED)) {
- autoDeleteMediaPlaybackCompleted = sp.getBoolean(
- PREF_AUTO_DELETE_MEDIA_PLAYBACK_COMPLETED, false);
- } else if (key.equals(PREF_AUTODELETE_MEDIA_ID)) {
- autoDeleteMediaId = sp.getLong(PREF_AUTODELETE_MEDIA_ID, -1);
} else if (key.equals(PREF_CURRENTLY_PLAYING_FEEDMEDIA_ID)) {
currentlyPlayingFeedMediaId = sp.getLong(
PREF_CURRENTLY_PLAYING_FEEDMEDIA_ID, NO_MEDIA_PLAYING);
@@ -136,9 +117,6 @@ public class PlaybackPreferences implements
}
}
- public static long getAutoDeleteMediaId() {
- return instance.autoDeleteMediaId;
- }
public static long getLastPlayedFeedId() {
instanceAvailable();
@@ -164,9 +142,4 @@ public class PlaybackPreferences implements
return instance.currentEpisodeIsVideo;
}
- public static boolean isAutoDeleteMediaPlaybackCompleted() {
- instanceAvailable();
- return instance.autoDeleteMediaPlaybackCompleted;
- }
-
}