mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
omit song from similar list, handle subsonic error
This commit is contained in:
parent
f81bea339b
commit
3a116e938e
4 changed files with 24 additions and 8 deletions
|
|
@ -980,7 +980,13 @@ const getSimilarSongs = async (args: SimilarSongsArgs): Promise<Song[]> => {
|
|||
throw new Error('Failed to get similar songs');
|
||||
}
|
||||
|
||||
return res.body.Items.map((song) => jfNormalize.song(song, apiClientProps.server, ''));
|
||||
return res.body.Items.reduce<Song[]>((acc, song) => {
|
||||
if (song.Id !== query.songId) {
|
||||
acc.push(jfNormalize.song(song, apiClientProps.server, ''));
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
|
||||
export const jfController = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue