1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 09:04:33 +02:00

Don't try to filter artists/albums in ScriptCommands. This would fail because filtering for 'We will rock you' should still return 'Queen' e.g.

This commit is contained in:
Christian Muehlhaeuser
2015-04-13 02:18:28 +02:00
parent 6a1d0e6666
commit c0175b37f1
2 changed files with 3 additions and 30 deletions

View File

@@ -107,7 +107,7 @@ ScriptCommand_AllAlbums::reportFailure()
void
ScriptCommand_AllAlbums::onAlbumsJobDone(const QVariantMap& result)
ScriptCommand_AllAlbums::onAlbumsJobDone( const QVariantMap& result )
{
ScriptJob* job = qobject_cast< ScriptJob* >( sender() );
Q_ASSERT( job );
@@ -129,19 +129,7 @@ ScriptCommand_AllAlbums::onAlbumsJobDone(const QVariantMap& result)
}
QList< Tomahawk::album_ptr > a = parseAlbumVariantList( resultArtists, result[ "albums" ].toList() );
if ( m_filter.isEmpty() )
emit albums( a );
else
{
QList< Tomahawk::album_ptr > filtered;
foreach( const Tomahawk::album_ptr& album, a )
{
if( album->name().toLower().contains( m_filter.toLower() ) ||
album->artist()->name().toLower().contains( m_filter.toLower() ) )
filtered.append( album );
}
emit albums( filtered );
}
emit albums( a );
emit done();
job->deleteLater();

View File

@@ -98,22 +98,7 @@ ScriptCommand_AllArtists::onArtistsJobDone( const QVariantMap& result )
}
QList< Tomahawk::artist_ptr > a = parseArtistVariantList( result[ "artists" ].toList() );
if ( m_filter.isEmpty() )
{
emit artists( a );
}
else
{
QList< Tomahawk::artist_ptr > filtered;
foreach( const Tomahawk::artist_ptr& artist, a )
{
if ( artist->name().contains( m_filter ) )
filtered.append( artist );
}
emit artists( a );
}
emit artists( a );
emit done();
job->deleteLater();