improve artist match

This commit is contained in:
Sayem Chowdhury 2021-03-25 00:09:47 +06:00
parent ca0ec8e436
commit b9f696ac6f
2 changed files with 5 additions and 3 deletions

View File

@ -103,7 +103,7 @@ test('PARSE DEEZER ARTIST', async (t) => {
t.deepEqual(response.info, {id: '13', type: 'artist'});
t.is(response.linktype, 'artist');
t.true(response.tracks.length > 3500);
t.true(response.tracks.length > 450);
});
test('PARSE SPOTIFY ARTIST', async (t) => {

View File

@ -103,8 +103,10 @@ export const parseInfo = async (url: string) => {
await queue.addAll(
artistAlbums.data.map((album) => {
return async () => {
if (album.ARTISTS.find((a) => a.ART_ID === info.id)) {
const albumTracks = await getAlbumTracks(album.ALB_ID);
tracks = [...tracks, ...albumTracks.data];
tracks = [...tracks, ...albumTracks.data.filter((t) => t.ART_ID === info.id)];
}
};
}),
);