1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Properly name artist stations

This commit is contained in:
Leo Franchi 2011-10-02 16:01:54 -04:00
parent 5d6f31a25d
commit 094e8653ff

View File

@ -290,7 +290,12 @@ CategoryAddItem::parsedDroppedTracks( const QList< query_ptr >& tracks )
QTimer::singleShot( 300, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) );
} else if( m_categoryType == SourcesModel::StationsCategory ) {
// seed the playlist with these song or artist filters
QString name = tracks.isEmpty() ? tr( "New Station" ) : tr( "%1 Station" ).arg( tracks.first()->track() );
QString name;
if ( sender() && sender()->property( "dragsource" ).toString() == "artist" )
name = tracks.isEmpty() ? tr( "New Station" ) : tr( "%1 Station" ).arg( ( tracks.first()->artist() ) );
else
name = tracks.isEmpty() ? tr( "New Station" ) : tr( "%1 Station" ).arg( tracks.first()->track() );
dynplaylist_ptr newpl = DynamicPlaylist::create( SourceList::instance()->getLocal(), uuid(), name, "", SourceList::instance()->getLocal()->friendlyName(), OnDemand, false );
newpl->setMode( OnDemand );