From 77ac2b537c06187a0f21872617f0affd5680487a Mon Sep 17 00:00:00 2001 From: Koen J Date: Thu, 20 Nov 2025 13:50:25 +0100 Subject: [PATCH] Fixed get last queue. --- .../java/com/futo/platformplayer/states/StatePlayer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt index 1ccf4497..5b8ce960 100644 --- a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt +++ b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt @@ -1,6 +1,7 @@ package com.futo.platformplayer.states import android.content.Context +import android.util.Log import androidx.annotation.OptIn import androidx.media3.common.C import androidx.media3.common.util.UnstableApi @@ -388,7 +389,11 @@ class StatePlayer { } if (queueVideos != null) { - val playlist = StatePlaylists.instance.getPlaylist(StatePlaylists.LAST_QUEUE_PLAYLIST_ID) ?: Playlist("Last Queue", queueVideos).apply { + Logger.i(TAG, "Update last queue: ${queueVideos.size} videos.") + val playlist = StatePlaylists.instance.getPlaylist(StatePlaylists.LAST_QUEUE_PLAYLIST_ID)?.apply { + videos.clear() + videos.addAll(queueVideos) + } ?: Playlist("Last Queue", queueVideos).apply { id = StatePlaylists.LAST_QUEUE_PLAYLIST_ID } StatePlaylists.instance.createOrUpdatePlaylist(playlist)