Repository navigation
Fix/missing artist parsing - #411
Merged
Merged
Conversation
Media.parse() and Album.parse() read json["artists"] and fell back to artists[0] when there was no "artist" field. A track or album with an empty or missing artists list (seen with tracks that are no longer available) therefore failed with IndexError or KeyError, and a JSON null "artist" with TypeError. One such item made a whole playlist or album listing fail. An item without any artist information now parses with artist = None (the attribute is already Optional) and artists = []. A null "artist" is treated as missing. Album.parse() keeps the artist it was given when the JSON has no artist information; otherwise its precedence is unchanged. Track flags missing from the JSON (payToStream, premiumStreamingOnly, editable, upload, spotlighted, url) now get the False/"" defaults the class declares instead of None, and copyright falls back to "" so unavailable tracks no longer expose a value that contradicts its type.
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.
Trackflags (pay_to_stream,premium_streaming_only,editable,upload,spotlighted) are nowFalseinstead ofNonewhen TIDAL omits them, andurlis an empty string - 64beaf9