When I switched from my crappy taglib module to using lame to add album art
(r162), I introduced a bug when album art is not present in the FLAC. Try to
fix it.
Add --id3v2-latin1. Default in newer lame is to transcode to UTF-16! Quite
wasteful on most of my files, and I don't have any that won't work fine in
latin1, so let's use that.
lame supports adding album art directly, it's just not very well documented
(still not in the man page in latest release), so switch to that instead of my
crappy taglib module
Move Tags class into new flac_archive package, fix a bug in it, and
test it. These stupid scripts will finally start sharing code and
getting some formal testing.
flac_archive/tags.py:
(Tags): Move here from flac2mp3, and rename ._tags to ._tracks .
The tag-loading loop from flac2mp3 get_tags becomes the new .load
method.
(Tags.get): Return all matching tag data instead of either global
or per-track (oops).
(Tags.gets): Adapt to that change, and allow other separators than
just '\n', which becomes a default.
(Tags.all, Tags.track): New methods for getting a tag block for
all tags (whole disc) or just a track, respectively. To be used
by fa-flacd in single-file and per-track modes, respectively.
flac2mp3:
Use flac_archive.tags.Tags. Use Tags.load in get_tags .
setup.py:
Note MIT license and install flac_archive package.
epg [Tue, 7 Nov 2006 09:07:28 +0000 (09:07 +0000)]
Add hack to pull down musicbrainz info without having a disc; useful
when you're away from home and rip WAVs into itunes... This should be
a separate program.
epg [Thu, 2 Nov 2006 10:42:28 +0000 (10:42 +0000)]
Hm, why just copy front cover PICTUREs from flac to mp3? The flac
PICTURE metadata block has the exact same metadata as the mp3 ID3v2
APIC frame; just copy them all.
flac.c:
(flac_pictures): Return fields in the same order they're found in
the FLAC format. Convert the description to a unicode object
rather than returning a UTF-8 encoded str object.
taglib.cc:
(taglib_apic): Take a list of picture tuples and add them all as
APIC frames.
(add_apic_frame_to_mp3): Take the list of picture tuples and pass
them straight to taglib_apic.
flac2mp3:
(flac2mp3): Take a list of picture tuples instead of just one;
pass them all to add_apic_frame_to_mp3.
(find_pics): Rename from find_pic. Save all PICTURE metadata
blocks rather than just saving the first front cover picture.
epg [Thu, 19 Oct 2006 07:13:18 +0000 (07:13 +0000)]
(flac2mp3): Don't need to int(track) now that the loop in main does it.
(Tags): New class that should be moved somewhere shared so fa-flacd
and others can use it. Simplifies keeping track of per-disc and
per-track tags.
(get_tags): Build and return a Tags object instead of mucking about
with different tags in inconsistent (and broken!) ways.
(main): Oy, main needs to be split up. Change the main loop to use
the Tags object, fix discnum-is-a-str-not-int bug, make track always
an int here (previously was sometimes str), correctly handle multiple
tracks per flac, and append PART to TITLE if present.
This is now tested; both multi-file and single-file modes work fine,
and multi-file is now fully parallelizable.
(flac): Refactor this to encode one wav file to one flac, instead of
looping over all the wavs for a multi-file mode. This leaves behind
the fa-rip directories instead of cleaning them up; i left a comment
where the cleanup should happen; easy enough to fix. When creating or
removing files or directories, test for $!{EEXIST} and $!{ENOENT} on
failure rather than stat(2)ing up front.
(flacloop): Move some of the multi-file processing here into our new
Jobs::run get-jobs function; it manages a queue of wav files so we can
fully parallelize even multi-file jobs, instead of having the disc as
the unit of parallelization.
Improve Jobs package:
- no longer need global @jobs and @finished
- @finished is gone completely
- new run function which takes care of all the details; you just give
it a function to call to get a new job function, and optional
reportingi functions.
epg [Fri, 23 Jun 2006 01:30:43 +0000 (01:30 +0000)]
Here's a simple hack to split single cue-containing flac files into
single-track flac files. It's almost entirely a copy/paste of
parts of fa-flacd and flac2mp3; all the common parts really should
be factored out...