mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 10:26:33 +02:00
ensure savePlayQueueByIndex uses a valid currentIndex
This commit is contained in:
@@ -2181,7 +2181,10 @@ export const SubsonicController: InternalControllerEndpoint = {
|
|||||||
if (hasFeature(apiClientProps.server, ServerFeature.SERVER_PLAY_QUEUE)) {
|
if (hasFeature(apiClientProps.server, ServerFeature.SERVER_PLAY_QUEUE)) {
|
||||||
const res = await ssApiClient(apiClientProps).savePlayQueueByIndex({
|
const res = await ssApiClient(apiClientProps).savePlayQueueByIndex({
|
||||||
query: {
|
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,
|
id: query.songs,
|
||||||
position: query.positionMs,
|
position: query.positionMs,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user