Skip to content

Commit

Permalink
fix: get back spotify genres first #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Feb 22, 2024
1 parent 5e5c3fe commit 48dea10
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down

0 comments on commit 48dea10

Please sign in to comment.