Implement "Downloaded and unplayed" subscription counter option (#6073)

This commit is contained in:
Erik Johnson 2022-09-18 11:03:10 -05:00 committed by GitHub
parent 6940c1a3c5
commit fcce8e9e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View File

@ -178,12 +178,14 @@
<item>@string/drawer_feed_counter_inbox</item>
<item>@string/drawer_feed_counter_unplayed</item>
<item>@string/drawer_feed_counter_downloaded</item>
<item>@string/drawer_feed_counter_downloaded_unplayed</item>
<item>@string/drawer_feed_counter_none</item>
</string-array>
<string-array name="nav_drawer_feed_counter_values">
<item>1</item>
<item>2</item>
<item>4</item>
<item>5</item>
<item>3</item>
</string-array>

View File

@ -4,7 +4,8 @@ public enum FeedCounter {
SHOW_NEW(1),
SHOW_UNPLAYED(2),
SHOW_NONE(3),
SHOW_DOWNLOADED(4);
SHOW_DOWNLOADED(4),
SHOW_DOWNLOADED_UNPLAYED(5);
public final int id;

View File

@ -1281,6 +1281,11 @@ public class PodDBAdapter {
case SHOW_DOWNLOADED:
whereRead = KEY_DOWNLOADED + "=1";
break;
case SHOW_DOWNLOADED_UNPLAYED:
whereRead = "(" + KEY_READ + "=" + FeedItem.NEW
+ " OR " + KEY_READ + "=" + FeedItem.UNPLAYED + ")"
+ " AND " + KEY_DOWNLOADED + "=1";
break;
case SHOW_NONE:
// deliberate fall-through
default: // NONE

View File

@ -76,6 +76,7 @@
<string name="drawer_feed_counter_inbox">Number of episodes in the inbox</string>
<string name="drawer_feed_counter_unplayed">Number of unplayed episodes</string>
<string name="drawer_feed_counter_downloaded">Number of downloaded episodes</string>
<string name="drawer_feed_counter_downloaded_unplayed">Number of downloaded and unplayed episodes</string>
<string name="drawer_feed_counter_none">None</string>
<!-- Bug report activity -->