summaryrefslogtreecommitdiff
path: root/model/src
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2022-08-07 20:53:11 +0200
committerGitHub <noreply@github.com>2022-08-07 20:53:11 +0200
commit440b20487b9c48ddc1e20ba008262689916e8eaa (patch)
tree38bbf41a708080b3b42d9a45e723138534f64f56 /model/src
parentd58debbf580dee6ea9728aeedac29db4524e7e2d (diff)
parente65fe6244b2131ce55c82d3ffb226521a9d8318e (diff)
downloadAntennaPod-440b20487b9c48ddc1e20ba008262689916e8eaa.zip
Merge pull request #6001 from ByteHamster/remove-favorite-tab
Remove favorites tab from episodes screen
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedItemFilter.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItemFilter.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItemFilter.java
index c9989e60a..460177d56 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItemFilter.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItemFilter.java
@@ -72,7 +72,36 @@ public class FeedItemFilter implements Serializable {
return properties.clone();
}
- public boolean isShowDownloaded() {
- return showDownloaded;
+ public boolean matches(FeedItem item) {
+ if (showNew && !item.isNew()) {
+ return false;
+ } else if (showPlayed && !item.isPlayed()) {
+ return false;
+ } else if (showUnplayed && item.isPlayed()) {
+ return false;
+ } else if (showPaused && !item.isInProgress()) {
+ return false;
+ } else if (showNotPaused && item.isInProgress()) {
+ return false;
+ } else if (showNew && !item.isNew()) {
+ return false;
+ } else if (showQueued && !item.isTagged(FeedItem.TAG_QUEUE)) {
+ return false;
+ } else if (showNotQueued && item.isTagged(FeedItem.TAG_QUEUE)) {
+ return false;
+ } else if (showDownloaded && !item.isDownloaded()) {
+ return false;
+ } else if (showNotDownloaded && item.isDownloaded()) {
+ return false;
+ } else if (showHasMedia && !item.hasMedia()) {
+ return false;
+ } else if (showNoMedia && item.hasMedia()) {
+ return false;
+ } else if (showIsFavorite && !item.isTagged(FeedItem.TAG_FAVORITE)) {
+ return false;
+ } else if (showNotFavorite && item.isTagged(FeedItem.TAG_FAVORITE)) {
+ return false;
+ }
+ return true;
}
}