[prev in list] [next in list] [prev in thread] [next in thread] 

List:       amarok
Subject:    Re: Do not show under various artists
From:       "Seb Ruiz" <ruiz () kde ! org>
Date:       2008-11-11 22:27:28
Message-ID: 60ebdd0b0811111427r2928e375ta69a6c6fe6389398 () mail ! gmail ! com
[Download RAW message or body]

2008/11/12 Ian Monroe <ian@monroe.nu>:
> On Mon, Nov 10, 2008 at 9:47 PM, Gary Steinert <gary.steinert@gmail.com> wrote:
>> This is a patch implementing the 'Do not show under Various Artists' context
>> menu action in the collection browser.
>> As far as I can tell, this isn't the prettiest of patches, but it gets the job
>> done.
>> Could someone please look this over and give me a nudge in the right direction
>> if it's not up to scratch. If I hear nothing in 48 hours I'll commit anyway.
>>
>> Index: src/collection/sqlcollection/SqlMeta.cpp
>> ===================================================================
>> --- src/collection/sqlcollection/SqlMeta.cpp    (revision 882361)
>> +++ src/collection/sqlcollection/SqlMeta.cpp    (working copy)
>> @@ -1471,7 +1471,16 @@
>>         else
>>         {
>>             debug() << "User selected album as non-compilation";
>> -            //TODO find album artist
>> +
>> +            QString select = "SELECT artist FROM tracks WHERE album = %1";
>> +            QStringList artistid = m_collection->query( select.arg( m_id ) );
>> +
>> +            m_artistId = artistid[0].toInt();
>> +            m_artist = this->tracks()[0]->artist();
>> +
>> +            QString update = "UPDATE albums SET artist = %1 WHERE id = %2;";
>> +            update = update.arg( m_artistId ).arg( m_id );
>> +            m_collection->query( update );
>>         }
>>         notifyObservers();
>>         m_collection->sendChangedSignal();
>>
>
> How does this interact with collection rescans?

It doesn't at all, so any changes will be lost on a rescan.


-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/
_______________________________________________
Amarok mailing list
Amarok@kde.org
https://mail.kde.org/mailman/listinfo/amarok
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic