mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
fix artist favorite songs (subsonic)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user