mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Playlist update again
This commit is contained in:
24
src/smapi.ts
24
src/smapi.ts
@@ -806,6 +806,30 @@ function bindSmapiSoapServiceToExpress(
|
||||
// </getExtendedMetadataResult>
|
||||
},
|
||||
}));
|
||||
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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user