zacharydenton/whatbetter — pull request #42 by milkyjoe (2013-01-15 04:26:41+00:00)
Title: Milky Joe's mega-patch

Hi Zach,

Thanks for writing this tool. I've made a host of bug fixes and improvements that are incorporated into this pull request. Most of the changes were made to improve the script's error-handing, and to do more to ensure that the uploaded transcodes are valid and better conform to What.CD rules.

Most of these changes are grouped into separate per-topic branches in my local repo (e.g., a separate branch with just the tagging changes), but by this point most of the later changes are dependent on earlier ones in one way or another, so I'm hoping you'll accept them all in one large pull rather than a topic at a time, as that would be quite a bit more work. The only change that I can imagine you might object to is the removal of unsupported What.CD formats from the transcoder (e.g., Ogg and AAC), as I'm aware that you might use transcoder.py for more than just uploading to What. I removed them because I had no convenient way to test them with all of the other changes I was making, and because it made the new tagging system significantly simpler.

Below is a short summary of the changes in this pull request. See the commit logs for details; most of the big changes have comprehensive check-in messages.

Among other things, I believe this pull request fixes #41, #22, #9, and #7.

Brief overview of changes:

- Support for a separate output directory (!= data_dir), for those of us who separate some of our torrents into "seed-only" directories.
- Clean up the mktorrent tempdir.
- Clean up transcode files if the transcode fails
- Many multiprocessing-related fixes, including detecting errors anywhere in the transcode process, interruptible transcodes (Ctrl-C), and kill all processes in the transcode pipeline if failed/interrupted.
- Numerous minor bug fixes/error-handling improvements.
- Eliminate support for unacceptable transcodes (Ogg, AAC).
- Major tag rewrite, which fixes problems caused by the existing mediafile.py implementation, ensures that the transcode has the tags required by the What.CD rules before uploading, and attempts some basic clean-up of the original release's tags in the transcode to reduce the likelihood of a trump.
- A no-upload mode, useful for testing or for those who prefer to upload manually.
- Skip pre-emphasis releases.
- Ignore dot-files (e.g., ._*.flac) when looking for files to transcode.

Thanks!