For #899, we need to change MediaFile's behavior (pre-write) based on whether
we're doing ID3v2.3 or not. So we need a field on the object, not a parameter
to `save()`.
* Remove generic messages for `UnreadableFileError`. The class
carries that information—so we see it if the exceptions crashes the
program. If the exception is caught (in `library`, `importer`,
and `autotag`) the type of the exceptions is logged.
* Attach file path to the exceptions. This allows us to determine
the file that crashed the application.
See #788
This was a no-op before but raises an exception on Mutagen 1.23. This fixes
the behavior (I'm not sure if we were using it anywhere) and the failing test.
The `Image.type_index` property is only used for tags that require an integer
to store the cover type like ID3v2. If the type of an image is not set we let
`type_index` return the integer for an "other" image. Other than a default
"front" value, this makes sure we do not inadvertidly add an image that will
be displayed in a player.
This is not really critical since list(Type)[i] works just as well. This fixes
a couple other problems from the enum transition:
- The name of TYPES was not really consistent with its new role as an enum
type. Renamed this ImageType.
- Fix a rather egregious bug in embedart (undefined reference to Image).
You now call update() followed by save(). This is mainly because the
implementation no longer performs lazy updates, so the need to pair tag
setting and writing together was diminished. Benefits in cleanliness:
- No need to duplicate the id3v2 option.
- Exception handling can be more precise.
- More closely resembles dict.update().
This eliminates a little bit of state redundancy in which StorageStyles needed
to know about their field's externally visible type. Now the MediaField itself
is *solely* responsible for external-type-related conversions; StorageStyles
need only worry about their *internal* types.
(I hope I didn't mess up any essential design decisions, @geigerzaehler.)