mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-08 21:20:45 +02:00
Compare commits
3 Commits
albumandar
...
script-col
Author | SHA1 | Date | |
---|---|---|---|
|
358c225b0b | ||
|
478113d910 | ||
|
33cf891daf |
@@ -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();
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user