diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-24 12:25:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 12:25:32 +0100 |
commit | 5218e06904e489f77da4078de775dd0a63b94ef4 (patch) | |
tree | 5184c4228bb66027b317d5b0fcc73e08f44d7117 /app | |
parent | 79856b7931eebc7093013861de78ac68228ea7e6 (diff) | |
download | AntennaPod-5218e06904e489f77da4078de775dd0a63b94ef4.zip |
Faster feed deletion (#7019)
Diffstat (limited to 'app')
4 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DeleteActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DeleteActionButton.java index 16a5a161c..8ee31a03c 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DeleteActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DeleteActionButton.java @@ -39,7 +39,7 @@ public class DeleteActionButton extends ItemActionButton { } LocalDeleteModal.showLocalFeedDeleteWarningIfNecessary(context, Collections.singletonList(item), - () -> DBWriter.deleteFeedMediaOfItem(context, media.getId())); + () -> DBWriter.deleteFeedMediaOfItem(context, media)); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/actions/EpisodeMultiSelectActionHandler.java b/app/src/main/java/de/danoeh/antennapod/fragment/actions/EpisodeMultiSelectActionHandler.java index 618c411ea..b4e8a4768 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/actions/EpisodeMultiSelectActionHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/actions/EpisodeMultiSelectActionHandler.java @@ -104,7 +104,7 @@ public class EpisodeMultiSelectActionHandler { for (FeedItem feedItem : items) { if (feedItem.hasMedia() && feedItem.getMedia().isDownloaded()) { countHasMedia++; - DBWriter.deleteFeedMediaOfItem(activity, feedItem.getMedia().getId()); + DBWriter.deleteFeedMediaOfItem(activity, feedItem.getMedia()); } } showMessage(R.plurals.deleted_multi_episode_batch_label, countHasMedia); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/swipeactions/DeleteSwipeAction.java b/app/src/main/java/de/danoeh/antennapod/fragment/swipeactions/DeleteSwipeAction.java index e196b96b4..462fcf968 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/swipeactions/DeleteSwipeAction.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/swipeactions/DeleteSwipeAction.java @@ -40,7 +40,7 @@ public class DeleteSwipeAction implements SwipeAction { } LocalDeleteModal.showLocalFeedDeleteWarningIfNecessary( fragment.requireContext(), Collections.singletonList(item), - () -> DBWriter.deleteFeedMediaOfItem(fragment.requireContext(), item.getMedia().getId())); + () -> DBWriter.deleteFeedMediaOfItem(fragment.requireContext(), item.getMedia())); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java index 5e86e14f0..48e43358f 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -153,7 +153,7 @@ public class FeedItemMenuHandler { context.sendBroadcast(MediaButtonStarter.createIntent(context, KeyEvent.KEYCODE_MEDIA_NEXT)); } else if (menuItemId == R.id.remove_item) { LocalDeleteModal.showLocalFeedDeleteWarningIfNecessary(context, Arrays.asList(selectedItem), - () -> DBWriter.deleteFeedMediaOfItem(context, selectedItem.getMedia().getId())); + () -> DBWriter.deleteFeedMediaOfItem(context, selectedItem.getMedia())); } else if (menuItemId == R.id.remove_inbox_item) { removeNewFlagWithUndo(fragment, selectedItem); } else if (menuItemId == R.id.mark_read_item) { @@ -232,7 +232,7 @@ public class FeedItemMenuHandler { FeedMedia media = item.getMedia(); boolean shouldAutoDelete = FeedUtil.shouldAutoDeleteItemsOnThatFeed(item.getFeed()); if (media != null && FeedItemUtil.hasAlmostEnded(media) && shouldAutoDelete) { - DBWriter.deleteFeedMediaOfItem(fragment.requireContext(), media.getId()); + DBWriter.deleteFeedMediaOfItem(fragment.requireContext(), media); } }; |