cli icon indicating copy to clipboard operation
cli copied to clipboard

WebNowPlaying does not return Artist value on 2.x

Open BaconDamage opened this issue 5 years ago • 9 comments

As title says - previous to new spotify and spicetify 2.x WebNowPlaying.js worked flawlessy, but now it does not return Artists value for some reason. Not sure if this belongs here...

(Also thanks for updates spicetify working with new spotify 👍 )

image

BaconDamage avatar May 18 '21 11:05 BaconDamage

Can confirm this happens on my PC too. I temporarily fixed it by editing webnowplaying.js as following:

Chaned the ARTIST value that on Line15-21:

ARTIST: () => {
    if (Spicetify.URI.isShow(Spicetify.Player.data.track.uri)) {
        return info.ALBUM();
    }

    return document.querySelector("#view-player-footer .artist").innerText
},

To this:

ARTIST: () => document.evaluate("//a[contains(@href, '/artist')]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerHTML,

This gets the name from the now-playing bar below the app.

IMPORTANT EDIT: Doesn't work on every song apparently.

aakyol avatar May 18 '21 13:05 aakyol

@BaconDamage Can you run spicetify path -e and paste the output here?

khanhas avatar May 18 '21 13:05 khanhas

@aakyol I'm 100% sure that you're using old webnowplaying.js Can you run the command above to find out its path, delete that file and try spicetify apply again

khanhas avatar May 18 '21 13:05 khanhas

@khanhas will do.

aakyol avatar May 18 '21 13:05 aakyol

Correct file should look like this: https://github.com/khanhas/spicetify-cli/blob/xpui/Extensions/webnowplaying.js

khanhas avatar May 18 '21 13:05 khanhas

@khanhas yeah I probably downloaded the old zip from old github 🤦‍♂️ Doesn't look like that AT ALL. Thanks a lot.

aakyol avatar May 18 '21 13:05 aakyol

Yep, working fine now. Thanks a lot @khanhas.

aakyol avatar May 18 '21 13:05 aakyol

That was it, somehow during transition to 2.01 it deleted this .js and I've copied it from my old download folder. Deleting old file + running spicetify apply fixed the issue. Thanks for fast reply!

BaconDamage avatar May 18 '21 13:05 BaconDamage

@BaconDamage exact same scenario as mine.

aakyol avatar May 18 '21 13:05 aakyol