diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-12-15 10:24:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-15 10:24:01 +0100 |
commit | c20a2ec349418994660b8d49a161b7a5bdf4b1db (patch) | |
tree | 8c693ff9903fda8ba6a5e8e0f6fbcb3b6445011c /app/src | |
parent | 32f7e73130bc5da87168b312ad39d152d05b3019 (diff) | |
parent | 0fe9335d750da398e3ad5ef389bdb2822d9b8719 (diff) | |
download | AntennaPod-c20a2ec349418994660b8d49a161b7a5bdf4b1db.zip |
Merge pull request #3685 from ByteHamster/reset-position-currently-playing
Stop playback when resetting position of currently playing item
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java | 5 |
1 files changed, 5 insertions, 0 deletions
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 60eaf14a5..2f3459beb 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -13,6 +13,7 @@ import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction.Action; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; +import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBWriter; @@ -200,6 +201,10 @@ public class FeedItemMenuHandler { break; case R.id.reset_position: selectedItem.getMedia().setPosition(0); + if (PlaybackPreferences.getCurrentlyPlayingFeedMediaId() == selectedItem.getMedia().getId()) { + PlaybackPreferences.writeNoMediaPlaying(); + IntentUtils.sendLocalBroadcast(context, PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE); + } DBWriter.markItemPlayed(selectedItem, FeedItem.UNPLAYED, true); break; case R.id.activate_auto_download: |