Skip to content
Snippets Groups Projects
Commit 875e96f8 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Playlistmanager: Nullity check on mediaplayer evt

parent eceed758
No related branches found
No related tags found
No related merge requests found
......@@ -742,9 +742,12 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
MediaPlayer.Event.Playing -> {
medialibrary.pauseBackgroundOperations()
val mw = withContext(Dispatchers.IO) {
val current = getCurrentMedia()
medialibrary.findMedia(current).apply { if (type == -1) type = current?.type ?: -1 }
}
getCurrentMedia()?.let {
medialibrary.findMedia(it).apply {
if (type == -1) type = it.type
}
}
} ?: return
if (newMedia) {
loadMediaMeta(mw)
saveMediaList()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment