Commit 45e27d09 authored by Geoffrey Métais's avatar Geoffrey Métais

Playback: pause medialibrary scan sooner

parent 4374edd7
......@@ -112,6 +112,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
Log.w(TAG, "Warning: empty media list, nothing to play !")
return
}
medialibrary.pauseBackgroundOperations()
currentIndex = if (isValidPosition(position)) position else 0
// Add handler after loading the list
......@@ -210,6 +211,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
mediaList.clear()
showAudioPlayer.value = false
service.onPlaybackStopped(systemExit)
medialibrary.resumeBackgroundOperations()
}
@MainThread
......@@ -253,6 +255,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
suspend fun playIndex(index: Int, flags: Int = 0) {
if (mediaList.size() == 0) {
Log.w(TAG, "Warning: empty media list, nothing to play !")
medialibrary.resumeBackgroundOperations()
return
}
currentIndex = if (isValidPosition(index)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment