You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: get_album fails to decode object-shaped preReleaseEndDateTime #105
get_album raises BaseClientError for albums whose getAlbum response includes preReleaseEndDateTime. Spotify now returns that field as an object, {"isoString": "...", "precision": "DAY" | "MINUTE"}, even when isPreRelease is false. AlbumDetails.pre_release_end_date_time is declared str | None, so decoding fails.
Minimal reproduction
fromspotapiimportSyncCataloguewithSyncCatalogue() ascatalogue:
album=catalogue.get_album("spotify:album:3LUcDBe7DZDExhHbZEQchk") # "Aba Khan" by Nytt Land, publicprint(album.name)
Expected behavior
get_album returns AlbumDetails with pre_release_end_date_time decoded as a date (like AlbumDetails.date's ReleaseDate), and search keeps those albums.
Actual behavior
spotapi.types.exceptions.BaseClientError: getAlbum: failed to deserialize AlbumDetails: AlbumDetails.pre_release_end_date_time: value does not match str | None
Thanks for the precise reproduction and error report! The mismatch is confirmed in both album models, and I also found a published Spotify-derived payload with an object-shaped preReleaseEndDateTime (including a case where precision is omitted).
I've opened #106 with a typed, backward-compatible fix and offline regressions covering the getAlbum decoder and album-search retention. CI is running now. I haven't independently retrieved the exact live response for spotify:album:3LUcDBe7DZDExhHbZEQchk yet, so I'll leave this issue open until the fix is verified against Spotify as well.
Thanks for reporting this, especially with a reproducible album URI! You were right — Spotify is returning preReleaseEndDateTime as an object now, but both of our album models were expecting a string.
I've fixed it in #106 and merged it into main. All the CI checks passed, and I added a regression test for the exact album you linked so we can catch this if it breaks again.
I haven't verified that specific album against live Spotify yet, so I'll leave the issue open until we confirm it. Really appreciate you taking the time to track this down!
Activity
fix(models): decode object-shaped album pre-release timestamps (#105)
fix(models): reuse typed timestamp for album detail pre-release metad…
test(catalogue): cover real pre-release shapes, legacy values and sea…
docs(changelog): record album timestamp compatibility fix (#105)
style(tests): keep async mock signature Black-compatible (#105)
Aran404 commentedon Nov 22, 2026
Thanks for the precise reproduction and error report! The mismatch is confirmed in both album models, and I also found a published Spotify-derived payload with an object-shaped
preReleaseEndDateTime(including a case whereprecisionis omitted).I've opened #106 with a typed, backward-compatible fix and offline regressions covering the
getAlbumdecoder and album-search retention. CI is running now. I haven't independently retrieved the exact live response forspotify:album:3LUcDBe7DZDExhHbZEQchkyet, so I'll leave this issue open until the fix is verified against Spotify as well.test(live): guard reported Aba Khan getAlbum regression (#105)
test(catalogue): use correct year-only vs ISO album date shapes (#105)
test(types): annotate mixed-shape fixture mappings for strict Pyright (…
Fix object-shaped album pre-release timestamps (#106)
Aran404 commentedon Nov 22, 2026
Thanks for reporting this, especially with a reproducible album URI! You were right — Spotify is returning
preReleaseEndDateTimeas an object now, but both of our album models were expecting a string.I've fixed it in #106 and merged it into
main. All the CI checks passed, and I added a regression test for the exact album you linked so we can catch this if it breaks again.I haven't verified that specific album against live Spotify yet, so I'll leave the issue open until we confirm it. Really appreciate you taking the time to track this down!
Balake commentedon Nov 22, 2026
@Aran404 thanks!
Aran404 commentedon Nov 22, 2026
No problem, let me know if that works now so I can publish 2.1.3 to pypi.
Balake commentedon Nov 22, 2026
@Aran404 This works for me! I had 10 albums that were failing and they all work on
mainnow.