vscode-spotify icon indicating copy to clipboard operation
vscode-spotify copied to clipboard

Not showing song name/author

Open negebauer opened this issue 4 years ago • 6 comments

This is what I'm seeing in my status bar

image

When I try to search for lyrics it shows the following

Song lyrics for  -  not found.
 You can add it on https://genius.com/ .

When I skip songs fast it shows the name for a moment but then it goes back to -

Screen Recording 2020-05-12 at 22 24 13

Is the name being lost or something?

negebauer avatar May 13 '20 02:05 negebauer

Yeah, I am getting the same error, is there any fix?

rvaidun avatar May 15 '20 18:05 rvaidun

It looks like a problem with Spotify's AppleScript implementation (it's probably broken in latest Spotify release)😑. Can any of you folks try smth next time you got this?

run in terminal

open -a 'Script Editor'

paste and run in editor

on escape_quotes(string_to_escape)
	set AppleScript's text item delimiters to the "\""
	set the item_list to every text item of string_to_escape
	set AppleScript's text item delimiters to the "\\\""
	set string_to_escape to the item_list as string
	set AppleScript's text item delimiters to ""
	return string_to_escape
end escape_quotes

tell application "Spotify"
	set ctrack to "{"
	set ctrack to ctrack & "\"artist\": \"" & my escape_quotes(current track's artist) & "\""
	set ctrack to ctrack & ",\"album\": \"" & my escape_quotes(current track's album) & "\""
	set ctrack to ctrack & ",\"disc_number\": " & current track's disc number
	set ctrack to ctrack & ",\"duration\": " & current track's duration
	set ctrack to ctrack & ",\"played_count\": " & current track's played count
	set ctrack to ctrack & ",\"track_number\": " & current track's track number
	set ctrack to ctrack & ",\"popularity\": " & current track's popularity
	set ctrack to ctrack & ",\"id\": \"" & current track's id & "\""
	set ctrack to ctrack & ",\"name\": \"" & my escape_quotes(current track's name) & "\""
	set ctrack to ctrack & ",\"album_artist\": \"" & my escape_quotes(current track's album artist) & "\""
	set ctrack to ctrack & ",\"artwork_url\": \"" & current track's artwork url & "\""
	set ctrack to ctrack & ",\"spotify_url\": \"" & current track's spotify url & "\""
	set ctrack to ctrack & "}"
end tell

and copy paste output here.

Meanwhile you can set spotify.forceWebApiImplementation to true in vscode settings.

ShyykoSerhiy avatar May 15 '20 20:05 ShyykoSerhiy

here is the output

{
  "artist": "",
  "album": "80s 100 Hits",
  "disc_number": 0,
  "duration": 223066,
  "played_count": 0,
  "track_number": 0,
  "popularity": 0,
  "id": "spotify:track:6ZEAXknmx2mrO3KgcDNpFI",
  "name": "",
  "album_artist": "",
  "artwork_url": "https://i.scdn.co/image/ab67616d0000b273db56ceff816b668b7b6f04ff",
  "spotify_url": "spotify:track:6ZEAXknmx2mrO3KgcDNpFI"
}

seems astir and name are the only ones that broke (maybe also album_artist?)

with the web api implementation it works

negebauer avatar May 15 '20 20:05 negebauer

Yep, it's broken in Spotify Mac app https://community.spotify.com/t5/Desktop-Mac/You-broke-AppleScript-Again/td-p/4937134

ShyykoSerhiy avatar May 16 '20 00:05 ShyykoSerhiy

Damn the Spotify update 😢

negebauer avatar May 16 '20 00:05 negebauer

Looks like they solved it https://community.spotify.com/t5/Desktop-Mac/You-broke-AppleScript-Again/m-p/4968840#M542109

But the song searching it still failing. For a song that doesn't have any lyrics it shows the no lyrics text. But for one that does have it doesn't do anything.

negebauer avatar Aug 07 '20 03:08 negebauer