1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

* Fixed logic error in DbCmd_TrackAttributes.

This commit is contained in:
Christian Muehlhaeuser 2012-05-22 10:41:12 +02:00
parent 95dccb8cf9
commit 7ffb3b2fef

View File

@ -49,7 +49,6 @@ void DatabaseCommand_TrackAttributes::exec( DatabaseImpl* lib )
PairList results;
if ( !m_ids.isEmpty() )
{
foreach ( const QID id, m_ids )
{
query.prepare( "SELECT v FROM track_attributes WHERE id = ? AND k = ?" );
@ -58,11 +57,13 @@ void DatabaseCommand_TrackAttributes::exec( DatabaseImpl* lib )
if ( query.exec() )
results.append( QPair< QID, QString >( id, query.value( 0 ).toString() ) );
}
} else {
}
else
{
query.prepare( "SELECT id, v FROM track_attributes WHERE k = ?" );
query.bindValue( 0, k );
query.exec();
while ( !query.next() )
while ( query.next() )
{
results.append( QPair< QID, QString >( query.value( 0 ).toString(), query.value( 1 ).toString() ) );
}