From 92899affab62873ca855d5dfcdc05bfa5fea47b7 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Mon, 3 Oct 2016 17:21:42 +0200 Subject: [PATCH] Add "has media" filter to episodes filter --- .../java/de/danoeh/antennapod/core/feed/FeedItemFilter.java | 6 ++++++ core/src/main/res/values/arrays.xml | 2 ++ core/src/main/res/values/strings.xml | 1 + 3 files changed, 9 insertions(+) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java index 9d8f4adf8..200153876 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java @@ -18,6 +18,7 @@ public class FeedItemFilter { private boolean showNotQueued = false; private boolean showDownloaded = false; private boolean showNotDownloaded = false; + private boolean showHasMedia = false; public FeedItemFilter(String properties) { this(TextUtils.split(properties, ",")); @@ -49,6 +50,9 @@ public class FeedItemFilter { case "not_downloaded": showNotDownloaded = true; break; + case "has_media": + showHasMedia = true; + break; } } } @@ -82,6 +86,8 @@ public class FeedItemFilter { if (showDownloaded && !downloaded) continue; if (showNotDownloaded && downloaded) continue; + if (showHasMedia && !item.hasMedia()) continue; + // If the item reaches here, it meets all criteria result.add(item); } diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index fba22b985..c8c5162ef 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -185,6 +185,7 @@ @string/hide_not_queued_episodes_label @string/hide_downloaded_episodes_label @string/hide_not_downloaded_episodes_label + @string/hide_has_media_label @@ -195,6 +196,7 @@ not_queued downloaded not_downloaded + has_media diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 4a56e9e15..e995a8040 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -131,6 +131,7 @@ Not queued Downloaded Not downloaded + Has media Filtered {fa-exclamation-circle} Last Refresh failed Open Podcast