Jellyfin: Don't fail entire sync if artist mbid is corrupt #1332
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.
Jellyfin does not seem to validate musicbrainz ids. It's basically a free text field in the Jellyfin UI, accepting even daft strings like "FEEDME". MA does validate them though, raising InvalidDataError if basic checks fail when setting the value on a model object. If that InvalidDataError exception is raised during a library sync then the sync will stop. This leads to a library with some artists, no albums and no tracks. This happened to my library after running Picard over it.
I would like to handle the exception, log a message the user can action, and then continue without bringing the MBID into MA. The rest of the users library is imported. And the user can see which track is broken, fix it, and then on the next sync it can be pulled in.
If you are happy with this change, I'd like to do a follow up PR to cover the other unprotected mbid cases in the sync process.
(In my case the field is "corrupt" because Jellyfin can't handle albums with multiple artists very well and has decided to put multiple artist mbid's against a single artist. This is so broken even parts of the Jellyfin UI can't handle it).