Merge pull request #3685 from ByteHamster/reset-position-currently-playing
Stop playback when resetting position of currently playing item
This commit is contained in:
commit
c20a2ec349
|
@ -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;
|
||||||
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction.Action;
|
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction.Action;
|
||||||
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
|
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.preferences.UserPreferences;
|
||||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||||
|
@ -200,6 +201,10 @@ public class FeedItemMenuHandler {
|
||||||
break;
|
break;
|
||||||
case R.id.reset_position:
|
case R.id.reset_position:
|
||||||
selectedItem.getMedia().setPosition(0);
|
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);
|
DBWriter.markItemPlayed(selectedItem, FeedItem.UNPLAYED, true);
|
||||||
break;
|
break;
|
||||||
case R.id.activate_auto_download:
|
case R.id.activate_auto_download:
|
||||||
|
|
Loading…
Reference in New Issue