In the case that Mutagen throws an exception while trying to read a file, we
throw an UnreadableFileError, which is a new superclass for FileTypeError.
On terminals where the LANG environment variable didn't list UTF-8 as the
terminal's character encoding, the Python print statement throws an error when
it encounters a character that can't be encoded. So now we manually use the
"replace" policy for all output to the terminal.
This entailed:
- changing the "flac" storage style option to "etc" to encompass both
flac and vorbis as the tags are very similar
- permitting multiple StorageStyles per field/format, to allow a
read-any/store-all approach to multiple field options
Previously, the db transaction was running concurrently with the file copying
and tag writing. This meant that the transaction went needlessly long and made
other db-writing processes time out. Now the transaction is short and occurs
after all the file operations.
current metadata to be correct if it's complete
Previously, we were using the Munkres algorithm (minimum bipartite matching) to
order tracks intelligently only as a fallback if the current metadata was
paradoxical or incomplete. This was because of a concern about the performance
of the potentially-O(n^3) Munkres solver. However, it was found that (a) the
performance is actually not bad, taking on the order of 0.02 to perform a
matching, and (b) there was no recourse for the tagger to reorder tracks that
were legitimately in the wrong order. Now, we get intelligent reordering of
badly tagged music even when the metadata seems to be complete.
To retain some of the functionality of the old orderer, the track distance
metric was expanded to include a component reflecting the track index.
In doing this, another bug was discovered in the UI that showed the track name
differences based on an arbitrary ordering. Now, the tag_album function returns
a reordered items list with every candidate.