QList<Tomahawk::query_ptr> Artist::tracks() { if ( m_queries.isEmpty() ) { DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); cmd->setArtist( this ); cmd->setSortOrder( DatabaseCommand_AllTracks::Album ); connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) ); Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) ); } return m_queries; }
QList<Tomahawk::query_ptr> ArtistPlaylistInterface::tracks() { if ( m_queries.isEmpty() && m_artist ) { DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks(); cmd->setArtist( m_artist.data() ); cmd->setSortOrder( DatabaseCommand_AllTracks::Album ); connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) ); Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) ); } return m_queries; }
QList<Tomahawk::query_ptr> ArtistPlaylistInterface::tracks() const { if ( m_queries.isEmpty() && m_artist ) { if ( ( m_mode == Mixed || m_mode == InfoSystemMode ) && !m_infoSystemLoaded ) { Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = m_artist.data()->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = id(); requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistSongs; requestData.timeoutMillis = 0; requestData.allSources = true; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ), SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) ); connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) ); } else if ( m_mode == DatabaseMode && !m_databaseLoaded ) { DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_collection ); cmd->setArtist( m_artist->weakRef() ); cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition ); connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ), SLOT( onTracksLoaded( QList<Tomahawk::query_ptr> ) ) ); Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) ); } } return m_queries; }