Skip to content

Refactor updatePlaylistImage function and comments#279

Open
rosgr100 wants to merge 1 commit into
daksh2k:masterfrom
rosgr100:master
Open

Refactor updatePlaylistImage function and comments#279
rosgr100 wants to merge 1 commit into
daksh2k:masterfrom
rosgr100:master

Conversation

@rosgr100
Copy link
Copy Markdown

@rosgr100 rosgr100 commented May 9, 2026

Refactor playlist image update function to use playlist ID instead of URI. Update various comments and improve HTML entity decoding.

fix(savePlaylists): replace broken sp:// endpoints with Platform API

Fix: Replace broken sp:// and Web API endpoints with Platform API

Problem

The extension is completely broken on current Spotify/Spicetify versions. All three sp://core-playlist Cosmos endpoints have been removed and return Resolver not found!. Direct calls to api.spotify.com consistently return 429 Too Many Requests when made from within the Spotify client.

Errors seen:

  • GET sp://core-playlist/v1/playlist/... Resolver not found!
  • POST sp://core-playlist/v1/rootlist ... Resolver not found!
  • PUT https://api.spotify.com/v1/playlists/... 429 Too Many Requests

Fix

Replaced all broken calls with Spicetify.Platform API equivalents, which route through Spotify's internal transport and are not rate-limited:

Before After
CosmosAsync.get(sp://core-playlist/v1/playlist/) Platform.PlaylistAPI.getMetadata() + getContents()
CosmosAsync.post(sp://core-playlist/v1/rootlist) Platform.RootlistAPI.createPlaylist()
CosmosAsync.post(api.spotify.com/.../tracks) Platform.PlaylistAPI.add() in chunks of 100
fetch PUT api.spotify.com/.../playlists (description) Platform.PlaylistAPI.setAttributes()

Also fixed: HTML entities in descriptions (e.g. /) are now decoded before writing, and tracks are paginated correctly for playlists over 100 tracks.

Legacy sp:// fallbacks are kept for older Spicetify versions where Platform.PlaylistAPI may not be available.

Fixes #264

Refactor playlist image update function to use playlist ID instead of URI. Update various comments and improve HTML entity decoding.


fix(savePlaylists): replace broken sp:// endpoints with Platform API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't save playlists: Error in Fetching!

1 participant