From 308a94d3b68a750ecb71341415d4b5274d160590 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sat, 11 Jul 2026 12:02:05 -0700 Subject: [PATCH] ensure savePlayQueueByIndex uses a valid currentIndex --- src/renderer/api/subsonic/subsonic-controller.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/api/subsonic/subsonic-controller.ts b/src/renderer/api/subsonic/subsonic-controller.ts index 1f77f443e..c4c43ceee 100644 --- a/src/renderer/api/subsonic/subsonic-controller.ts +++ b/src/renderer/api/subsonic/subsonic-controller.ts @@ -2181,7 +2181,10 @@ export const SubsonicController: InternalControllerEndpoint = { if (hasFeature(apiClientProps.server, ServerFeature.SERVER_PLAY_QUEUE)) { const res = await ssApiClient(apiClientProps).savePlayQueueByIndex({ query: { - currentIndex: query.currentIndex !== undefined ? query.currentIndex : undefined, + currentIndex: + query.currentIndex !== undefined && query.currentIndex < query.songs.length + ? Math.max(0, query.currentIndex) + : undefined, id: query.songs, position: query.positionMs, },