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

Playback: pause medialibrary scan sooner

parent 4374edd7
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
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