[Tracker] PATCH - Refactoring albumart fetching



Hackers!

Currently Tracker's media file extractor will on top of trying to
extract embedded media art from files, perform a heuristic on the
directory of the media file.

The reason why it does this heuristic is to find album art related to
the media file.

Usually are media files grouped together in a directory, though. For
example like this:

/location/Freaky Freak/The greatest hits/Freaky-Freak_-_The-greatest-hits_-_I-can-sing.mp3
/location/Freaky Freak/The greatest hits/Freaky-Freak_-_The-greatest-hits_-_You-can-sing.mp3
/location/Freaky Freak/The greatest hits/Freaky-Freak_-_The-greatest-hits_-_We-can-sing.mp3
/location/Freaky Freak/The greatest hits/Freaky-Freak_-_The-greatest-hits_-_They-can-sing.mp3

Or whatever filenaming format the w3ird peoples on thiz planetz have
used for their albums, songs, media files and etcetera.

Right now will the extractor foreach file in such a directory repeat the
complete heuristic.

With this patch we'll throw the request for a heuristic back to the
indexer. The indexer has a queue where it also merges the requests
together. In the patch the indexer does this by forming a key using the
dirname, album and artist.

Which means that if a request for a heuristic is made for ten files sang
by the same artist, grouped into the same album, stored in the same
directory, which is kinda common by the way, I'm again making my
sentences too long, making it hard for people to read them, then the
indexer will simply merge those ten together and perform just one
heuristic instead. Saving precious computar cycles.

It's quite a refactor, and this close to a next 0.6.x release it would I
think be good if a few extra couple of eyes would review and test the
code before I push it.

Please review

-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be

Attachment: albumart-refactor.diff
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]