From c50c6786effd674e87e1ec88957c71864624c071 Mon Sep 17 00:00:00 2001 From: Grigory Date: Sat, 2 Dec 2023 19:33:17 +0500 Subject: [PATCH] refactor(utils): use `Player.data.item` --- src/logic/Utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logic/Utils.ts b/src/logic/Utils.ts index 8f9cd3a0..b71b5b2e 100644 --- a/src/logic/Utils.ts +++ b/src/logic/Utils.ts @@ -391,7 +391,7 @@ async function waitForAlbumArt(): Promise { // Only return when the album art is loaded return new Promise((resolve) => { setInterval(() => { - const albumArtSrc = Spicetify.Player.data?.track?.metadata?.image_xlarge_url; + const albumArtSrc = Spicetify.Player.data?.item?.metadata?.image_xlarge_url; if (albumArtSrc) { resolve(albumArtSrc); } @@ -404,7 +404,7 @@ export const initAlbumArtBasedColor = (scheme: ColourScheme) => { // and update the color scheme accordingly Spicetify.Player.addEventListener("songchange", async () => { await sleep(1000); - let albumArtSrc = Spicetify.Player.data?.track?.metadata?.image_xlarge_url; + let albumArtSrc = Spicetify.Player.data?.item?.metadata?.image_xlarge_url; // If it doesn't exist, wait for it to load if (albumArtSrc == null) {