fix artist favorite songs (subsonic)

This commit is contained in:
jeffvli
2026-02-03 23:58:31 -08:00
parent f56a836ffd
commit 2b6b0cb38b
@@ -1361,7 +1361,7 @@ export const SubsonicController: InternalControllerEndpoint = {
throw new Error('Failed to get song list');
}
const allResults =
let allResults =
(res.body.starred?.song || []).map((song) =>
ssNormalize.song(
song,
@@ -1371,6 +1371,15 @@ export const SubsonicController: InternalControllerEndpoint = {
),
) || [];
const filterArtistIds = query.albumArtistIds || query.artistIds;
if (filterArtistIds?.length) {
const idSet = new Set(filterArtistIds);
allResults = allResults.filter((song) =>
song.albumArtists?.some((aa) => idSet.has(aa.id)),
);
}
return sortAndPaginate(allResults, {
limit: query.limit,
sortBy: query.sortBy,