Skip to content

fix: allow both items and tracks in FullPlaylist#563

Merged
ramsayleung merged 6 commits into
ramsayleung:masterfrom
jullanggit:master
Apr 9, 2026
Merged

fix: allow both items and tracks in FullPlaylist#563
ramsayleung merged 6 commits into
ramsayleung:masterfrom
jullanggit:master

Conversation

@jullanggit
Copy link
Copy Markdown
Contributor

@jullanggit jullanggit commented Mar 29, 2026

Description

Spotify now also send both items and tracks for FullPlaylist, handle this when deserializing.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

I have not been able to test this in practice, because I got hit with a 24h ratelimit, but I have added a test using the example response from the spotify api website.

Is this change properly documented?

Yes, see CHANGELOG.md

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the FullPlaylistShadow model to handle both items and tracks fields as optional, providing better compatibility with Spotify API responses. The From implementation now prioritizes items but falls back to tracks. Additionally, a new test case was added to verify this logic, along with minor whitespace cleanups in existing tests. Feedback was provided to improve the readability of the newly added test by shortening excessively long and repetitive JSON arrays.

Comment thread tests/test_models.rs Outdated
@ramsayleung
Copy link
Copy Markdown
Owner

The CI is failing, the rest looks good to me

@ramsayleung
Copy link
Copy Markdown
Owner

The CHANGELOG.md has a merge conflict

@ramsayleung ramsayleung merged commit dabc85c into ramsayleung:master Apr 9, 2026
7 checks passed
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.

2 participants