Skip to content

fix(tidal): handle null copyright field in Tidal album and track metadata - #1047

Open
boomesh11 wants to merge 1 commit into
nathom:devfrom
boomesh11:fix/tidal-null-copyright
Open

boomesh11 wants to merge 1 commit into
nathom:devfrom
boomesh11:fix/tidal-null-copyright

Conversation

@boomesh11

Copy link
Copy Markdown

Fixes #978.

Problem

When Tidal returns "copyright": null in track or album API responses,
esp.get("copyright", "") returns None, causing yped(None, str) in AlbumMetadata.from_tidal() and AlbumMetadata.from_tidal_playlist_track_resp() (streamrip/metadata/album.py) to raise AssertionError.

Fix

  • Replaced
    esp.get("copyright", "") with
    esp.get("copyright") or "" in both Tidal metadata constructors in streamrip/metadata/album.py.

Verification

  • Added ests/test_tidal_null_copyright.py covering both AlbumMetadata.from_tidal() and AlbumMetadata.from_tidal_playlist_track_resp() with copyright: None.
  • Ran pytest tests/test_tidal_null_copyright.py: 1 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.

[BUG] Tidal: null copyright field causes AssertionError when downloading single tracks

1 participant