Skip to content

Handle null mediaMetadata on tracks and albums - #419

Open
Petru101 wants to merge 1 commit into
EbbLabs:mainfrom
Petru101:fix/null-media-metadata
Open

Petru101 wants to merge 1 commit into
EbbLabs:mainfrom
Petru101:fix/null-media-metadata

Conversation

@Petru101

Copy link
Copy Markdown
Contributor

TIDAL sometimes sends "mediaMetadata": null for a track or album. parse_track only handled the key being missing, so an available track with null metadata raises AttributeError: 'NoneType' object has no attribute 'get', and Album.parse raises TypeError: 'NoneType' object is not subscriptable for any album with null metadata. One such item makes a whole playlist fail to load, which is how High Tide users ran into it (Nokse22/high-tide#217, Nokse22/high-tide#218).

This treats null like a missing value: tracks get the same empty tags as before, and albums keep their default tags.

Tests: four offline tests in tests/test_parsing.py, two for null metadata (both fail without the fix) and two checking tags are still read. make lint passes.

🤖 Generated with Claude Code

TIDAL sometimes sends "mediaMetadata": null. parse_track only handled a
missing key, so an available track with null metadata raised
AttributeError, and Album.parse raised TypeError for any album with null
metadata. One such item makes a whole playlist fail to load, as reported in
High Tide (Nokse22/high-tide#217, EbbLabs#218). Null is now treated like a missing
value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant