From 48dea105b805a8d0b10789f8845efde8246d3465 Mon Sep 17 00:00:00 2001 From: Mikkel RINGAUD Date: Thu, 22 Feb 2024 11:52:26 +0100 Subject: [PATCH] fix: get back spotify genres first #4 --- src/index.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index ad6dd0c..14ebe87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -215,16 +215,8 @@ function initializeSpotifyGenres(): void { } async function injectGenre() { - let allGenres = [...lastFmTags]; - - // Get genres from artists if Last.FM tags are not available. - if (allGenres.length === 0) { - console.warn(LOG_PREFIX, "No Last.FM tags found for the current track. Fetching genres from artists..."); - let allArtistURI = getAllArtistsURIFromCurrentTrack(); - allGenres = await getAllArtistsGenres(allArtistURI); - } - - console.info(LOG_PREFIX, "All genres of the current track: ", allGenres); + let allArtistURI = getAllArtistsURIFromCurrentTrack(); + let allGenres = await getAllArtistsGenres(allArtistURI); if (!allGenres) { console.warn(LOG_PREFIX, "No genres found for the current track. Removing...");