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

* Allow filtering by album name.

This commit is contained in:
Christian Muehlhaeuser 2011-09-05 04:56:11 +02:00
parent b73d5b4424
commit 33d8c0314c

View File

@ -45,8 +45,9 @@ DatabaseCommand_AllArtists::exec( DatabaseImpl* dbi )
if ( !m_filter.isEmpty() )
{
filterToken = QString( "AND file_join.track = track.id AND ( artist.name LIKE :filterA OR track.name LIKE :filterT )" );
tables = "artist, track, file, file_join";
filterToken = QString( "AND file_join.album = album.id AND file_join.track = track.id "
"AND ( artist.name LIKE :filterA OR album.name LIKE :filterB OR track.name LIKE :filterC )" );
tables = "artist, track, album, file, file_join";
}
else
tables = "artist, file, file_join";
@ -68,7 +69,8 @@ DatabaseCommand_AllArtists::exec( DatabaseImpl* dbi )
if ( !m_filter.isEmpty() )
{
query.bindValue( ":filterA", QString( "%%1%" ).arg( m_filter ) );
query.bindValue( ":filterT", QString( "%%1%" ).arg( m_filter ) );
query.bindValue( ":filterB", QString( "%%1%" ).arg( m_filter ) );
query.bindValue( ":filterC", QString( "%%1%" ).arg( m_filter ) );
}
query.exec();