rembo10/headphones — pull request #473 by palli81 (2012-02-09 23:02:38+00:00)
Title: "want lossless" for lossy versions in library

This is a patch for #48.

Unfortunately it requires DB changes (so BACK UP before testing), it adds a Format column to "tracks" and "have". Upon startup it starts a thread to check for all tracks in those tables that don't have a format value and updates them, basically a one time process, if HP stops before finishing the update it picks up where it stopped.

New imports are inserted with the format value. This required a lot of one-line changes in the importer.

The templates are updated as well to reflect that the format is now known.

As for the "want lossless" part I split headphones.MEDIA_FORMATS into LOSSY_MEDIA_FORMATS and LOSSLESS_MEDIA_FORMATS and then extended the search* functions to allow for an explicit search for lossless regardless of the users preferred bitrate settings. This also introduces a "Wanted Lossless" status to account for if the lossless version is not found initially then future scheduled searches might and should exclude lossy versions.

So, if you have an album that has some lossy or mixed formats you see a "want lossless" link in the status column.

I think I have tested everything pretty thoroughly, but more testing is always better.