[Amarok] Fix the VA node being shown in the case where the

Jeff Mitchell mitchell at kde.org
Wed Sep 23 17:29:58 CEST 2009


Jeff Mitchell wrote:
> Maximilian Kossick wrote:
> I know fuckall about QueryMaker in general, much less SqlQueryMaker, and
> wanted to get a fix in for 2.2 final.
> 
> That being said:
> 
> Switching the order of the tables -- having the first table be albums
> instead of tracks -- should probably fix the issue, according to the
> information I was given above.
> 
> I will try to figure out how to do that using QueryMaker and the queries
> that are being put in.

Well, what do you know. SqlQueryMaker::linkTables():

    d->linkedTables |= Private::TAGS_TAB; //HACK!!!
    //assuming that tracks is always included for now
    if( !d->linkedTables )
        return;

    if( d->linkedTables & Private::TAGS_TAB )
        d->queryFrom += " tracks";
    if( d->linkedTables & Private::URLS_TAB )
        d->queryFrom += " INNER JOIN urls ON tracks.url = urls.id";
    if( d->linkedTables & Private::ARTIST_TAB )
        d->queryFrom += " LEFT JOIN artists ON tracks.artist = artists.id";
    if( d->linkedTables & Private::ALBUM_TAB )
        d->queryFrom += " LEFT JOIN albums ON tracks.album = albums.id";

So someone put in a HACK!!! assuming that tracks is always included. As
a result the LEFT JOIN will always be in the wrong order for this
particular case, causing the NULL row, causing the extraneous DataPtr,
causing the Various Artists node to show up incorrectly.

And git-blame shows the lucky winner to be.......Maximilian Kossick,
come on down!

So, want to help me fix this?

(I'm also a little skeezed out by the fact that it checks for the
existence of linkedTables *after* adding to it. I'm guessing that's so
that the hack's statement that tracks is always included is valid, but
still...)

Now, if you think this can be fixed without the possibility of screwing
everything up (past times that QueryMaker has been touched it has
sometimes caused massive breakage) for 2.2, great. If not, I think my
hack will work fine until after 2.2 is released.

--Jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090923/be3c4cdd/attachment.sig 


More information about the Amarok-devel mailing list