mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +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');
|
throw new Error('Failed to get song list');
|
||||||
}
|
}
|
||||||
|
|
||||||
const allResults =
|
let allResults =
|
||||||
(res.body.starred?.song || []).map((song) =>
|
(res.body.starred?.song || []).map((song) =>
|
||||||
ssNormalize.song(
|
ssNormalize.song(
|
||||||
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, {
|
return sortAndPaginate(allResults, {
|
||||||
limit: query.limit,
|
limit: query.limit,
|
||||||
sortBy: query.sortBy,
|
sortBy: query.sortBy,
|
||||||
|
|||||||
Reference in New Issue
Block a user