Skip to content

Commit

Permalink
fix: fetch album art via Last.fm should use album artist name (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
momo-p authored Dec 20, 2024
1 parent ae65922 commit f097836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/features/discord-rpc/use-discord-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export const useDiscordRpc = () => {
activity.largeImageKey = song?.imageUrl;
}

if (generalSettings.lastfmApiKey && song?.album && song?.artists.length) {
console.log('Fetching album info for', song.album, song.artists[0].name);
if (generalSettings.lastfmApiKey && song?.album && song?.albumArtists.length) {
console.log('Fetching album info for', song.album, song.albumArtists[0].name);
const albumInfo = await fetch(
`https://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=${generalSettings.lastfmApiKey}&artist=${encodeURIComponent(song.artistName)}&album=${encodeURIComponent(song.album)}&format=json`,
`https://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=${generalSettings.lastfmApiKey}&artist=${encodeURIComponent(song.albumArtists[0].name)}&album=${encodeURIComponent(song.album)}&format=json`,
);

const albumInfoJson = await albumInfo.json();
Expand Down

0 comments on commit f097836

Please sign in to comment.