Review Request: Restore heuristics to guess whether album is a compilation

Alexey Neyman stilor at att.net
Mon Mar 19 00:45:22 UTC 2012



> On March 18, 2012, 9:39 p.m., Ralf Engels wrote:
> > Are the unit test running?
> > 
> > There is one specific scenario that the current scanner is handling (since years. No new change).
> > 
> > ITunes stile collections put tracks from the same album but different artist into different directories like this:
> > 
> > Michael Jackson
> >  + Bad
> >     + Smooth Criminal
> > Quincy Jones
> >  + Bad
> >     + Commentary
> > 
> > If your fix doesn't break the unit test I am all for committing the fix.
> > Also you might want to make a new unit test to prevent somebody later on to change the behaviour for the worse.

Ralf,

I wasn't able to run the unit test; even though I installed google mock 1.6.0 ("apt-get install google-mock") on Kubuntu 12.04, cmake does not detect it:

-----------------------------------------------------------------------------
-- The following REQUIRED packages could NOT be located on your system.
-- You must install these packages before continuing.
-----------------------------------------------------------------------------
   * gmock (1.4 or higher)  <http://code.google.com/p/googlemock/>
     Used in Amarok's tests.

-----------------------------------------------------------------------------

For the same reason, I didn't add a new unit test.

But I am afraid this is exactly the behavior I am trying to fix. With this change, your example would result in two (or more separate albums): "Michael Jackson - Bad" and "Quincy Jones - Bad".

So, your change was fixing iTunes but breaking the heuristics Amarok used before. Could you think of a solution that would also handle the following scenario:

ABBA
 + The Album
    + Eagle
    + Take a chance on me
    + One man one woman
Chris Norman
 + The Album
    + As good as it gets
    + Every little thing
    + Red hot screaming love

I.e., two completely separate albums being merged? One solution I could think of would be to merge tracks into single compilation if they all share the same year (is it the case with iTunes?). However, this is still prone to errors, for example if the tracks in both directories lack the year tag.

Perhaps, make it a config option? Something like:

[ ] Detect iTunes-style compilations


- Alexey


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104294/#review11582
-----------------------------------------------------------


On March 16, 2012, 12:13 a.m., Alexey Neyman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104294/
> -----------------------------------------------------------
> 
> (Updated March 16, 2012, 12:13 a.m.)
> 
> 
> Review request for Amarok.
> 
> 
> Description
> -------
> 
> Older amarok used the following heuristics to determine whether a particular
> album is a compilation (from a comment in 
> amarok-2.2.1/src/collection/sqlcollection/ScanResultProcessor.cpp):
> 
>     //using the following heuristics:
>     //if more than one album is in the dir, use the artist of each track as albumartist
>     //if all tracks have the same artist, use it as albumartist
>     //try to find the albumartist A: tracks must have the artist A or A feat. B (and variants)
>     //if no albumartist could be found, it's a compilation
> 
> 
> However, more recent Amarok versions started to merge different albums
> with different artist in separate directories together, as explained above.
> Amarok started to assume all albums with same name to be compilations
> (even if in separate directories) since the following commit:
> 
> dfd8b457d7094144563c51b2528afdbe23ffc344
> Ralf Engels
> Fix all collection scanner auto tests.
> 
> Now, amarok first scans all directories (sorting albums by the name)
> and then tries to process *album names*, one at a time. If it finds
> more than one instance of an album name, it assumes it to be a compilation.
> Thus, it lost the heuristics in employed before ("if more than one album
> is in the dir...").
> 
> While it is still possible to force the right behavior
> by selecting "Do not show under Various Artists" for each of the erroneous
> albums, it would still be better to restore the original heuristics as there
> may be lots of albums merged this way. I think the old heuristics made sense
> (why would albums be put into separate directories otherwise, if they are
> a single compilation album?).
> 
> The attached patch restores the following logic: If any given directory
> contains tracks that were sorted into a single album and and that album
> was not created as a compilation (i.e. it has non-empty artists), this
> album is excluded from being merged with other albums to create a "compilation".
> 
> 
> Diffs
> -----
> 
>   src/core-impl/collections/db/ScanResultProcessor.cpp 4f02a16 
> 
> Diff: http://git.reviewboard.kde.org/r/104294/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alexey Neyman
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20120319/9c252fd9/attachment-0001.html>


More information about the Amarok-devel mailing list