Merge pull request #2675 from ByteHamster/delete-feed-while-playing
Stop playback service when feed is deleted
This commit is contained in:
commit
930330fbb4
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue