Add "has media" filter to episodes filter

This commit is contained in:
Martin Fietz 2016-10-03 17:21:42 +02:00
parent cc675b06be
commit 92899affab
3 changed files with 9 additions and 0 deletions

View File

@ -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);
}

View File

@ -185,6 +185,7 @@
<item>@string/hide_not_queued_episodes_label</item>
<item>@string/hide_downloaded_episodes_label</item>
<item>@string/hide_not_downloaded_episodes_label</item>
<item>@string/hide_has_media_label</item>
</string-array>
<string-array name="episode_filter_values">
@ -195,6 +196,7 @@
<item>not_queued</item>
<item>downloaded</item>
<item>not_downloaded</item>
<item>has_media</item>
</string-array>
<string-array name="image_cache_size_options">

View File

@ -131,6 +131,7 @@
<string name="hide_not_queued_episodes_label">Not queued</string>
<string name="hide_downloaded_episodes_label">Downloaded</string>
<string name="hide_not_downloaded_episodes_label">Not downloaded</string>
<string name="hide_has_media_label">Has media</string>
<string name="filtered_label">Filtered</string>
<string name="refresh_failed_msg">{fa-exclamation-circle} Last Refresh failed</string>
<string name="open_podcast">Open Podcast</string>