Merge pull request #2690 from Bnyro/master

Fix the queue order in the background player mode
This commit is contained in:
Bnyro 2023-01-14 15:44:50 +01:00 committed by GitHub
commit 766694d909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -177,12 +177,14 @@ class BackgroundMode : Service() {
RetrofitInstance.api.getStreams(videoId)
}.getOrNull() ?: return@launch
// add the playlist video to the queue
if (PlayingQueue.isEmpty() && !keepQueue) updateQueue()
// save the current stream to the queue
streams?.toStreamItem(videoId)?.let {
PlayingQueue.updateCurrent(it)
}
// add the playlist video to the queue
if (PlayingQueue.isEmpty() && !keepQueue) updateQueue()
handler.post {
playAudio(seekToPosition)
}

View File

@ -472,7 +472,8 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
videoId!!,
exoPlayer.currentPosition,
playlistId,
channelId
channelId,
true
)
handler.postDelayed({
(activity as MainActivity).navController.navigate(R.id.audioPlayerFragment)