From f0978365d4e3ad6fbb4e3343cfea22f030349f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=82=E3=82=82=E3=81=B4?= <41295891+momo-p@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:31:44 +0700 Subject: [PATCH] fix: fetch album art via Last.fm should use album artist name (#855) --- src/renderer/features/discord-rpc/use-discord-rpc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/features/discord-rpc/use-discord-rpc.ts b/src/renderer/features/discord-rpc/use-discord-rpc.ts index 24578b84..d9eed7cf 100644 --- a/src/renderer/features/discord-rpc/use-discord-rpc.ts +++ b/src/renderer/features/discord-rpc/use-discord-rpc.ts @@ -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();