fix: count local feed episodes as downloaded in subscription counter (#8500)

### Description

Local folder feeds have no download records since files are placed
directly on-device. The subscription counter showed 0 downloaded episodes even
when episodes existed in the folder.

Fixes #7534

### Checklist
<!-- 
To help us keep the issue tracker clean and work as efficient as
possible,
  please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [ ] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [ ] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [ ] I have run the automated code checks using `./gradlew checkstyle
lint`
- [ ] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [ ] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [ ] If it is a core feature, I have added automated tests
This commit is contained in:
Shaik Sameer
2026-06-12 16:24:41 +05:30
committed by GitHub
parent 6b725a4d92
commit be5308b938
11 changed files with 30 additions and 15 deletions

View File

@ -19,6 +19,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia;
import de.danoeh.antennapod.model.feed.SortOrder;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
/**
* Implementation of the EpisodeCleanupAlgorithm interface used by AntennaPod.
@ -98,6 +99,7 @@ public class APCleanupAlgorithm extends EpisodeCleanupAlgorithm {
for (FeedItem item : downloadedItems) {
if (item.hasMedia()
&& item.getMedia().isDownloaded()
&& (!item.getFeed().isLocalFeed() || UserPreferences.isAutoDeleteLocal())
&& !item.isTagged(FeedItem.TAG_QUEUE)
&& item.isPlayed()
&& !item.isTagged(FeedItem.TAG_FAVORITE)) {

View File

@ -16,6 +16,7 @@ import de.danoeh.antennapod.model.feed.FeedItemFilter;
import de.danoeh.antennapod.model.feed.SortOrder;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
/**
* A cleanup algorithm that removes any item that isn't in the queue and isn't a favorite
@ -83,6 +84,7 @@ public class APQueueCleanupAlgorithm extends EpisodeCleanupAlgorithm {
for (FeedItem item : downloadedItems) {
if (item.hasMedia()
&& item.getMedia().isDownloaded()
&& (!item.getFeed().isLocalFeed() || UserPreferences.isAutoDeleteLocal())
&& !item.isTagged(FeedItem.TAG_QUEUE)
&& !item.isTagged(FeedItem.TAG_FAVORITE)) {
candidates.add(item);

View File

@ -83,6 +83,7 @@ public class ExceptFavoriteCleanupAlgorithm extends EpisodeCleanupAlgorithm {
for (FeedItem item : downloadedItems) {
if (item.hasMedia()
&& item.getMedia().isDownloaded()
&& (!item.getFeed().isLocalFeed() || UserPreferences.isAutoDeleteLocal())
&& !item.isTagged(FeedItem.TAG_FAVORITE)) {
candidates.add(item);
}