Fix feed counters including non-subscribed podcasts (#7334)

This commit is contained in:
ByteHamster 2024-08-24 10:54:08 +02:00 committed by GitHub
parent 600fdf0f8c
commit 6b63c6b9bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1309,7 +1309,7 @@ public class PodDBAdapter {
} }
private Map<Long, Integer> conditionalFeedCounterRead(String whereRead, long... feedIds) { private Map<Long, Integer> conditionalFeedCounterRead(String whereRead, long... feedIds) {
String limitFeeds = ""; String limitFeeds;
if (feedIds.length > 0) { if (feedIds.length > 0) {
// work around TextUtils.join wanting only boxed items // work around TextUtils.join wanting only boxed items
// and StringUtils.join() causing NoSuchMethodErrors on MIUI // and StringUtils.join() causing NoSuchMethodErrors on MIUI
@ -1321,6 +1321,8 @@ public class PodDBAdapter {
// there's an extra ',', get rid of it // there's an extra ',', get rid of it
builder.deleteCharAt(builder.length() - 1); builder.deleteCharAt(builder.length() - 1);
limitFeeds = KEY_FEED + " IN (" + builder.toString() + ") AND "; 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 " final String query = "SELECT " + KEY_FEED + ", COUNT(" + TABLE_NAME_FEED_ITEMS + "." + KEY_ID + ") AS count "