[mp3togo] audiotags diff

sim reallifesim at gmail.com
Mon May 29 01:04:08 PDT 2006


On 5/28/06, Justus Pendleton <justus at ryoohki.net> wrote:
> Here is a patch to change mp3togo over to using the audiotags library I
> posted earlier. It is actually pretty small. Most of tags.py goes away
> with this change. A few functions got changed from methods to regular
> functions. I've only tested it on a few mp3s this evening but it seems
> to be working as expected.

<patch snipped>

Thanks Justus,
This is a big step in the right direction. Thank you for your work.
Your patch applied cleanly to the source tree and mostly works.

There are a few issues with it though:

First: The output files are not actually tagged on my machine. The
tags are read in okay as I can get mp3togo to produce a garbled index
file, but the output mp3s have no tags. Your announcement of audiotags
does mention that it requires a recent svn version of mutagen and I am
running the latest released version, 1.2 from the Debian testing
archive. It is quite likely that this is the problem, even so, it
remains a problem.

My goal is to get mp3togo into Debian and to meet that goal, mp3togo
cannot depend on anything not yet available in Debian. This problem
will solve itself in time as the upstream development version of
mutagen matures and is released and packaged. I am prepared to fork a
development version of mp3togo in the meantime if necessary so that
work can continue.

Second: flac files throw an ErrorUnknownFileType error. wav input
files throw the same exception. This is not good as wav is a supported
input format and of course has no provision for metadata tags. The old
Tags class attempts to guess the right values for untagged files, if
the files are within a 'usual' directory structure, the guesses made
are fairly good.

I have myself used mp3togo to batch process a tree of wav files into
tagged mp3s, this is another use for the software, but a very handy
one.

In the absence of a guessing algorithm, the interaction between the
--format option and untagged files (wav or mp3) will be dangerous,
likely resulting in the output files overwriting one another. I just
tested this, it throws an exceptions and bails out on untagged files,
not as bad as overwriting, but still wrong.

My music archive is in fairly good shape, but I can envision angry
limewire users deleting mp3togo in frustration over this.

Third: The audiotags library needs to be properly packaged. I used
wget to download the files from your site and just put them into
/usr/local/lib/python2.3/site-packages/audiotags
This is fine for me, but doesn't meet the "to install, just type
apt-get install mp3togo" requirement.

The library could be integrated within mp3togo, just as it is
integrated within Quod Libet, but as it is generally useful, it would
probably be better to package it independently.

It is not difficult to set up distutils for a pure python source
package and packaging for Debian is not much harder. I'd be happy to
do this myself, but it must be done before mp3togo will be releasable.

Fourth: The index file writing facility is broken. It seems the new
tags dictionary just contains the string values of the tags, the old
Tags class actually stores a list containing strings so that multiple
values can be present for formats that support that (ogg and flac).

Fifth: Looking at the audiotags source, the modules named for file
types are just boilerplate around the mutagen library. I'm not sure
exactly what it all does yet, but there is a prominent warning in the
comment for AudioFile declaring that the function is not thread safe.
This is not a problem right now, but I've been trying to keep
everything thread safe in anticipation of a GUI front end and other
possible future uses.

The abstractions that present a uniform interface to the various file
formats in __init__.py are serving the same function that the Tags
class served, they hide the details of the tag formats and make access
available in a standard way. It seems to me that this boilerplate
around mutagen could just as well go in Tags replacing the old
boilerplate around ID3, ogg.vorbis and metaflac. There is a bunch of
Quod Libet specific stuff like ratings and playcounts that don't have
a well defined meaning in the context of mp3togo.


I do want to switch to mutagen for tagging, but I think it might be
better to wrap it with the existing Tags class rather than use the
AudioFile class from Quod Libet. Mutagen has been designed to be used
as a library. I'm going to have to study the code more extensively, I
certainly don't understand it yet.

Thanks again for the patch Justus, I appreciate the contribution.

-- 
sim



More information about the mp3togo mailing list