From 6b63c6b9bb71f9a66bc99b9a3b5fb864438a5d98 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 24 Aug 2024 10:54:08 +0200 Subject: [PATCH] Fix feed counters including non-subscribed podcasts (#7334) --- .../de/danoeh/antennapod/storage/database/PodDBAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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 "