Refactor updatePlaylistImage function and comments#279
Open
rosgr100 wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 APIProblem
The extension is completely broken on current Spotify/Spicetify versions. All three
sp://core-playlistCosmos endpoints have been removed and returnResolver not found!. Direct calls toapi.spotify.comconsistently return429 Too Many Requestswhen 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 RequestsFix
Replaced all broken calls with
Spicetify.PlatformAPI equivalents, which route through Spotify's internal transport and are not rate-limited: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 100fetch 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 wherePlatform.PlaylistAPImay not be available.Fixes #264