Repository navigation
Conversation
SyncCatalogue().get_album("spotify:album:3LUcDBe7DZDExhHbZEQchk") raised
BaseClientError: getAlbum: failed to deserialize AlbumDetails:
AlbumDetails.pre_release_end_date_time: value does not match str | None
Spotify now returns preReleaseEndDateTime as {"isoString": ...,
"precision": "DAY" | "MINUTE"}, even when isPreRelease is false, but the
models declared str | None.
Decode it as ReleaseDate | None on AlbumDetails and on the album search
hit (Album), which shares the field. Search skips undecodable hits, so
those albums were silently dropped from results. ReleaseDate moves to
models.catalogue.common so album.py can use it without an import cycle.
Add an offline regression test built from a trimmed real getAlbum
response, and examples/album_lookup.py to reproduce against the live 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.
SyncCatalogue().get_album("spotify:album:3LUcDBe7DZDExhHbZEQchk")raisedSpotify now returns
preReleaseEndDateTimeas{"isoString": ..., "precision": "DAY" | "MINUTE"}, even whenisPreReleaseisfalse, but the models declaredstr | None.Decode it as
ReleaseDate | NoneonAlbumDetailsand on the album search hit (Album), which shares the field. Search skips undecodable hits, so those albums were silently dropped from results.ReleaseDatemoves tomodels.catalogue.commonsoalbum.pycan use it without an import cycle.Add an offline regression test built from a trimmed real
getAlbumresponse, andexamples/album_lookup.pyto reproduce against the live API.Summary
Adds ability to parse the object for
SyncCatalogue().get_albumwithpreReleaseEndDateTimeWhy
See #105
Closes #105
Verification
python -m pytest -qpython -m pyrightpython -m ruff check .python -m black --check .Contract and lifecycle notes