The regex «[\+-]?[0-9]*» possibly matches a single minus/plus, which would then
be passed on to int(), raising a ValueError from within _safe_cast. The test
suite covered this for float, but not for int.
We now make sure we actually have a number after the sign by using a Kleene
plus.
I'm not sure how this got messed up, but this was:
- Trying to store album gain in the track peak part of the SoundCheck tag!
- Not writing the album gain to the non-SC free-form RG tag!
Together, this led to serious weirdness when writing these fields on AAC
files.
To be clear, we currently *only* support track-level data for SoundCheck. We
also record album-level RG information in non-iTunes tags, but that's
separate. A little googling suggests that SoundCheck now has album-level data,
but supporting that is a separate issue.
MusicBrainz provids composer, lyricist and arranger infomations related
to individual recordings. This commit adds query parameters to fetch them, and
write down to media files.
Tagging mapping is implemented according MusicBrainz Picard's data:
https://picard.musicbrainz.org/docs/mappings/
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
This is part of the effort to separate MediaFile from beets (#1966). It avoids
using the beets-specific logging infrastructure. This commit is part of
fdebab657d6e85de56b3996e8fdece09796940ae from the new MediaFile repository.
This simplifies the exception-handling story. It also clarifies exactly what's
going on, which I didn't fully realize before: Mutagen *never* raises IOError
anymore, even for IO-related errors, so MediaFile doesn't either.
Instead of the individial mutagen format exceptions use the
mutagen.MutagenError exception introduced in 1.25.
Since 1.33 mutagen will only raise MutagenError for load/save/delete
and no longer raise IOError. Translate both errors to UnreadableFileError
to support older and newer mutagen versions. Unify error handling
in __init__(), save() and delete().
Since it's no longer possible to get an IOError from MediaFile, adjust
all callers and tests accordingly.
This was tested with mutagen 1.27 and current mutagen master.