From 1fd8e13668cb3f49284c3d72c0d2274d7684a85a Mon Sep 17 00:00:00 2001 From: Wolfgang Kulhanek Date: Wed, 22 Oct 2025 18:25:15 +0200 Subject: [PATCH] Playlist update again --- src/smapi.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/smapi.ts b/src/smapi.ts index 5f053ac..1289c5f 100644 --- a/src/smapi.ts +++ b/src/smapi.ts @@ -806,6 +806,30 @@ function bindSmapiSoapServiceToExpress( // }, })); + case "playlists": + return musicLibrary + .playlists() + .then((it) => + Promise.all( + it.map((playlist) => ({ + id: playlist.id, + name: playlist.name, + coverArt: playlist.coverArt, + entries: [], + })) + ) + ) + .then(slice2(paging)) + .then(([page, total]) => ({ + getExtendedMetadataResult: { + count: page.length, + index: paging._index, + total, + mediaCollection: page.map((it) => + playlist(urlWithToken(apiKey), it) + ), + }, + })); default: throw `Unsupported getExtendedMetadata id=${id}`; }