diff options
author | Udi Finkelstein <github@udifink.com> | 2015-07-07 22:13:32 +0300 |
---|---|---|
committer | Udi Finkelstein <github@udifink.com> | 2015-07-09 01:16:49 +0300 |
commit | a22fa8660bccae0f9e740bcf09d00006e878c5d5 (patch) | |
tree | 314ee0e68135468f55321771cf6786530c80fcc0 | |
parent | 153ac4e12cf5c6b89e6514a90380a22e19e74e9a (diff) | |
download | AntennaPod-a22fa8660bccae0f9e740bcf09d00006e878c5d5.zip |
FeedPreferences.getCurrentAutoDelete() now calls UserPreferences.isAutoDelete() by itself, instead of receiving it as a parameter.
6 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java index c74d87866..9a25674b6 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java @@ -97,7 +97,7 @@ public class NewEpisodesFragment extends AllEpisodesFragment { long itemId = token.getFeedItemId(); FeedItem item = DBReader.getFeedItem(context, itemId); FeedMedia media = item.getMedia(); - if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { + if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete()) { DBWriter.deleteFeedMediaOfItem(context, media.getId()); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index f7e1ba767..46148a214 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -431,7 +431,7 @@ public class QueueFragment extends Fragment { long itemId = token.getFeedItemId(); FeedItem item = DBReader.getFeedItem(context, itemId); FeedMedia media = item.getMedia(); - if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { + if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete()) { DBWriter.deleteFeedMediaOfItem(context, media.getId()); } } diff --git a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java index d05da8bb7..990b3bd54 100644 --- a/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java +++ b/app/src/main/java/de/danoeh/antennapod/service/PlayerWidgetService.java @@ -62,7 +62,7 @@ public class PlayerWidgetService extends Service { DBWriter.markItemRead(this, item, true, false); DBWriter.removeQueueItem(this, item, false); DBWriter.addItemToPlaybackHistory(this, media); - if (item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { + if (item.getFeed().getPreferences().getCurrentAutoDelete()) { Log.d(TAG, "Delete " + media.toString()); DBWriter.deleteFeedMediaOfItem(this, media.getId()); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java index cb264db03..88da865cc 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedPreferences.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.feed; import android.content.Context; import de.danoeh.antennapod.core.storage.DBWriter; import org.apache.commons.lang3.StringUtils; +import de.danoeh.antennapod.core.preferences.UserPreferences; /** * Contains preferences for a single feed. @@ -82,10 +83,10 @@ public class FeedPreferences { this.auto_delete_action = auto_delete_action; } - public boolean getCurrentAutoDelete(boolean isAutoDelete) { + public boolean getCurrentAutoDelete() { switch (auto_delete_action) { case GLOBAL: - return isAutoDelete; + return UserPreferences.isAutoDelete(); case YES: return true; 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 6db77540f..737f0aefd 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 @@ -584,7 +584,7 @@ public class PlaybackService extends Service { } // Delete episode if enabled - if(item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { + if(item.getFeed().getPreferences().getCurrentAutoDelete()) { DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media.getId()); Log.d(TAG, "Episode Deleted"); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java index 76ecf09b6..835a8c1d1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java @@ -196,7 +196,7 @@ public class PlaybackServiceMediaPlayer { DBWriter.markItemRead(context, item, true, false); DBWriter.removeQueueItem(context, item, false); DBWriter.addItemToPlaybackHistory(context, oldMedia); - if (item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { + if (item.getFeed().getPreferences().getCurrentAutoDelete()) { Log.d(TAG, "Delete " + oldMedia.toString()); DBWriter.deleteFeedMediaOfItem(context, oldMedia.getId()); } |