Stop playback service when item of deleted feed is played

Closes #2425
This commit is contained in:
ByteHamster 2018-05-05 18:23:29 +02:00
parent e16a111a12
commit 304696d59e
2 changed files with 6 additions and 0 deletions

View File

@ -609,6 +609,9 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
public void shutdown() {
executor.shutdown();
if (mediaPlayer != null) {
try {
mediaPlayer.stop();
} catch (Exception ignore) { }
mediaPlayer.release();
}
releaseWifiLockIfNecessary();

View File

@ -188,6 +188,9 @@ public class DBWriter {
if(queue.remove(item)) {
removed.add(item);
}
if (item.getState() == FeedItem.State.PLAYING && PlaybackService.isRunning) {
context.stopService(new Intent(context, PlaybackService.class));
}
if (item.getMedia() != null
&& item.getMedia().isDownloaded()) {
File mediaFile = new File(item.getMedia()