Prevent a crash if MusicBrainz release date is missing #139
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.
If MusicBrainz returns data for a CD being ripped but no release date is returned (e.g. https://musicbrainz.org/release/340b94f5-139e-4f7b-90dd-82d04a70c57b), we attempt to set the
DATE
tag toNone
(which is caught by mutagen), causing the following crash:To resolve the issue, this PR adds a check to see if there is a value for release date before setting it. I've not added a warning message, as this is already output before the crash occurs:
Not sure if this should have a unit test & if so where it should go (don't seem to be any MusicBrainz unit tests for track ripping?), so I've not added one - let me know if I should.
Fixes #133.