Skip to content

bugfix: handle missing items in Playlist and PlaylistTracks#767

Open
Belov-Dev wants to merge 1 commit into
joostlek:mainfrom
Belov-Dev:fix/playlist-missing-items
Open

bugfix: handle missing items in Playlist and PlaylistTracks#767
Belov-Dev wants to merge 1 commit into
joostlek:mainfrom
Belov-Dev:fix/playlist-missing-items

Conversation

@Belov-Dev
Copy link
Copy Markdown

Problem:
Spotify API returns simplified playlist objects (e.g. in user playlist lists) where tracks contains only href and total without items.

This causes KeyError/deserialization failure:
Field "items" of type PlaylistTracks is missing in Playlist instance.

Fix:

  • Make Playlist.items optional (None default)
  • Use d.get("items") or [] in PlaylistTracks.pre_deserialize to handle missing field gracefully

@Belov-Dev Belov-Dev changed the title fix: handle missing items in Playlist and PlaylistTracks bugfix: handle missing items in Playlist and PlaylistTracks Apr 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions Bot added the stale There has not been activity on this issue or PR for quite some time. label May 7, 2026
Copy link
Copy Markdown
Owner

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

I am not sure when this happens. Can you elaborate what kind of playlists have this and can we add tests for this?

@github-actions github-actions Bot removed the stale There has not been activity on this issue or PR for quite some time. label May 8, 2026
@Belov-Dev
Copy link
Copy Markdown
Author

I am not sure when this happens. Can you elaborate what kind of playlists have this and can we add tests for this?
Unfortunately I can't rollback my local environment, I changed this Spotify plugin to Music Assistant (it has own Spotify integration plugin).

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