mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2026-08-18 11:05:49 +00:00
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:
@ -44,7 +44,7 @@ public class DeleteActionButton extends ItemActionButton {
|
||||
|
||||
@Override
|
||||
public int getVisibility() {
|
||||
if (item.getMedia() != null && (item.getMedia().isDownloaded() || item.getFeed().isLocalFeed())) {
|
||||
if (item.getMedia() != null && item.getMedia().isDownloaded()) {
|
||||
return View.VISIBLE;
|
||||
}
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ public class EpisodeMultiSelectActionHandler {
|
||||
// download the check episodes in the same order as they are currently displayed
|
||||
int downloaded = 0;
|
||||
for (FeedItem episode : items) {
|
||||
if (episode.hasMedia() && !episode.isDownloaded() && !episode.getFeed().isLocalFeed()) {
|
||||
if (episode.hasMedia() && !episode.isDownloaded()) {
|
||||
DownloadServiceInterface.get().download(activity, episode);
|
||||
downloaded++;
|
||||
}
|
||||
@ -155,7 +155,7 @@ public class EpisodeMultiSelectActionHandler {
|
||||
if (!feedItem.hasMedia()) {
|
||||
continue;
|
||||
}
|
||||
if (feedItem.getMedia().isDownloaded() || feedItem.getFeed().isLocalFeed()) {
|
||||
if (feedItem.getMedia().isDownloaded()) {
|
||||
countHasMedia++;
|
||||
DBWriter.deleteFeedMediaOfItem(activity, feedItem.getMedia());
|
||||
} else if (DownloadServiceInterface.get().isDownloadingEpisode(feedItem.getMedia().getDownloadUrl())) {
|
||||
|
||||
@ -86,9 +86,8 @@ public class FeedItemMenuHandler {
|
||||
canMarkPlayed |= !item.isPlayed();
|
||||
canMarkUnplayed |= item.isPlayed();
|
||||
canResetPosition |= hasMedia && item.getMedia().getPosition() != 0;
|
||||
canDelete |= item.getFeed().isLocalFeed() || (hasMedia && item.getMedia().isDownloaded()) || isDownloading;
|
||||
canDownload |= hasMedia && !item.getMedia().isDownloaded()
|
||||
&& !item.getFeed().isLocalFeed() && !isDownloading;
|
||||
canDelete |= (hasMedia && item.getMedia().isDownloaded()) || isDownloading;
|
||||
canDownload |= hasMedia && !item.getMedia().isDownloaded() && !isDownloading;
|
||||
canAddFavorite |= !item.isTagged(FeedItem.TAG_FAVORITE);
|
||||
canRemoveFavorite |= item.isTagged(FeedItem.TAG_FAVORITE);
|
||||
canShowTranscript |= item.hasTranscript();
|
||||
|
||||
@ -35,7 +35,7 @@ public class DeleteSwipeAction implements SwipeAction {
|
||||
|
||||
@Override
|
||||
public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filter) {
|
||||
if (!item.isDownloaded() && !item.getFeed().isLocalFeed()) {
|
||||
if (!item.isDownloaded()) {
|
||||
return;
|
||||
}
|
||||
LocalDeleteModal.showLocalFeedDeleteWarningIfNecessary(
|
||||
@ -45,6 +45,6 @@ public class DeleteSwipeAction implements SwipeAction {
|
||||
|
||||
@Override
|
||||
public boolean willRemove(FeedItemFilter filter, FeedItem item) {
|
||||
return filter.showDownloaded && (item.isDownloaded() || item.getFeed().isLocalFeed());
|
||||
return filter.showDownloaded && item.isDownloaded();
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ public class StartDownloadSwipeAction implements SwipeAction {
|
||||
public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filter) {
|
||||
if (item.getMedia() == null) {
|
||||
EventBus.getDefault().post(new MessageEvent(fragment.getString(R.string.no_media_label)));
|
||||
} else if (item.getFeed().isLocalFeed() || item.isDownloaded()) {
|
||||
} else if (item.isDownloaded()) {
|
||||
EventBus.getDefault().post(new MessageEvent(fragment.getString(R.string.already_downloaded)));
|
||||
} else {
|
||||
new DownloadActionButton(item).onClick(fragment.requireContext());
|
||||
|
||||
Reference in New Issue
Block a user