1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-08 21:20:45 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Dominik Schmidt
358c225b0b Add stub for passing filter to [album]Tracks() in script collection 2015-04-07 00:53:19 +02:00
Dominik Schmidt
478113d910 Pass filter to [artist]Albums() in script collection 2015-04-07 00:51:30 +02:00
Dominik Schmidt
33cf891daf Pass filter to artists() in script collection 2015-04-07 00:50:47 +02:00
3 changed files with 27 additions and 7 deletions

View File

@@ -71,18 +71,25 @@ ScriptCommand_AllAlbums::exec()
return;
}
ScriptJob* job;
QString methodName;
QVariantMap arguments;
if ( m_artist )
{
QVariantMap arguments;
methodName = "artistAlbums";
arguments[ "artist" ] = m_artist->name();
job = collection->scriptObject()->invoke( "artistAlbums", arguments );
}
else
{
job = collection->scriptObject()->invoke( "albums" );
methodName = "albums";
}
if ( !m_filter.isEmpty() )
{
arguments[ "filter" ] = m_filter;
}
ScriptJob* job = collection->scriptObject()->invoke( methodName, arguments );
connect( job, SIGNAL( done( QVariantMap ) ), SLOT( onAlbumsJobDone( QVariantMap ) ), Qt::QueuedConnection );
job->start();
}

View File

@@ -64,7 +64,13 @@ ScriptCommand_AllArtists::exec()
Tomahawk::ScriptCollection* collection = qobject_cast< Tomahawk::ScriptCollection* >( m_collection.data() );
Q_ASSERT( collection );
ScriptJob* job = collection->scriptObject()->invoke( "artists" );
QVariantMap arguments;
if ( !m_filter.isEmpty() )
{
arguments[ "filter" ] = m_filter;
}
ScriptJob* job = collection->scriptObject()->invoke( "artists", arguments );
connect( job, SIGNAL( done( QVariantMap ) ), SLOT( onArtistsJobDone( QVariantMap ) ), Qt::QueuedConnection );
job->start();
}

View File

@@ -65,9 +65,16 @@ ScriptCommand_AllTracks::exec()
}
ScriptJob* job;
QVariantMap arguments;
// TODO: implement filter
// if ( !m_filter.isEmpty() )
// {
// arguments[ "filter" ] = m_filter;
// }
if( m_album )
{
QVariantMap arguments;
arguments[ "artist" ] = m_album->artist()->name();
arguments[ "album" ] = m_album->name();
@@ -75,7 +82,7 @@ ScriptCommand_AllTracks::exec()
}
else
{
job = collection->scriptObject()->invoke( "tracks" );
job = collection->scriptObject()->invoke( "tracks", arguments );
}