summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-08-24 10:54:08 +0200
committerGitHub <noreply@github.com>2024-08-24 10:54:08 +0200
commit6b63c6b9bb71f9a66bc99b9a3b5fb864438a5d98 (patch)
tree40c74910d5cadac8eeb1f8e4675293d24f85d0ca
parent600fdf0f8c823c2561d1a2c3e1904294da54493e (diff)
downloadAntennaPod-6b63c6b9bb71f9a66bc99b9a3b5fb864438a5d98.zip
Fix feed counters including non-subscribed podcasts (#7334)
-rw-r--r--storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
index fddee8d2e..1e019e0e9 100644
--- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
+++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
@@ -1309,7 +1309,7 @@ public class PodDBAdapter {
}
private Map<Long, Integer> conditionalFeedCounterRead(String whereRead, long... feedIds) {
- String limitFeeds = "";
+ String limitFeeds;
if (feedIds.length > 0) {
// work around TextUtils.join wanting only boxed items
// and StringUtils.join() causing NoSuchMethodErrors on MIUI
@@ -1321,6 +1321,8 @@ public class PodDBAdapter {
// there's an extra ',', get rid of it
builder.deleteCharAt(builder.length() - 1);
limitFeeds = KEY_FEED + " IN (" + builder.toString() + ") AND ";
+ } else {
+ limitFeeds = SELECT_WHERE_FEED_IS_SUBSCRIBED + " AND ";
}
final String query = "SELECT " + KEY_FEED + ", COUNT(" + TABLE_NAME_FEED_ITEMS + "." + KEY_ID + ") AS count "