rembo10/headphones — pull request #1499 by basilfx (2014-03-31 21:14:34+00:00)
Title: Postprocess improvements

Sometimes I drop some downloads into the download folder for post processing. However, they are not processed because they haven't been snatched, or the folder isn't of the right format. Black hole downloads should be much better handled now.

Commit 7bb7cf9 adds support for extracting artist, album and year from the metadata of a folder. It's more or less a majority voting algorithm, with a few edge cases.

Commit 17f1bc5 restructures the order of post processing. In the current code, it could be possible that the release group ID added to a folder is ignored if one of the other attempts failed. In the commit, I reordered the code to alway go from snatched -> folder name -> metadata (new) -> release group ID. Debugging is added, which results in something similar to this (tested for album without any metadata):

```
31-mrt-2014 22:57:28 - INFO :: Thread-12 : Found 1 folders to process
31-mrt-2014 22:57:28 - INFO :: Thread-12 : Processing: Wolfgang Gartner 5f2ac718-47f7-4170-bccd-3700cf8a3ef2
31-mrt-2014 22:57:28 - DEBUG :: Thread-12 : Attempting to find album in the snatched table
31-mrt-2014 22:57:28 - DEBUG :: Thread-12 : Attempting to extract name, album and year from folder name
31-mrt-2014 22:57:28 - DEBUG :: Thread-12 : Attempting to extract name, album and year from metadata
31-mrt-2014 22:57:28 - INFO :: Thread-12 : No metadata in media files found, ignoring
31-mrt-2014 22:57:28 - DEBUG :: Thread-12 : Attempting to extract release group from folder name
31-mrt-2014 22:57:28 - INFO :: Thread-12 : Found a (possibly) valid Musicbrainz identifier in album folder name - continuing post-processing
31-mrt-2014 22:57:29 - INFO :: Thread-12 : Now adding/updating artist: Wolfgang Gartner
31-mrt-2014 22:57:29 - INFO :: Thread-12 : ArtistID: fc3f7bc9-8ced-48e3-8d6d-66384e9e01dc , ArtistName: Wolfgang Gartner
31-mrt-2014 22:57:29 - INFO :: Thread-12 : Now adding album: Weekend in America
31-mrt-2014 22:57:29 - INFO :: Thread-12 : Addition complete for: Weekend in America - Wolfgang Gartner
```