Fixed clearing the playlist when MediaPlayerService isn't running

This commit is contained in:
Nite 2020-10-20 11:29:05 +02:00
parent 356af198e0
commit 9eeff3fabc
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
1 changed files with 10 additions and 1 deletions

View File

@ -361,7 +361,16 @@ public class MediaPlayerControllerImpl implements MediaPlayerController
public synchronized void clear(boolean serialize)
{
MediaPlayerService mediaPlayerService = MediaPlayerService.getRunningInstance();
if (mediaPlayerService != null) mediaPlayerService.clear(serialize);
if (mediaPlayerService != null) {
mediaPlayerService.clear(serialize);
} else {
// If no MediaPlayerService is available, just empty the playlist
downloader.clear();
if (serialize) {
downloadQueueSerializer.serializeDownloadQueue(downloader.downloadList,
downloader.getCurrentPlayingIndex(), getPlayerPosition());
}
}
jukeboxMediaPlayer.getValue().updatePlaylist();
}