mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
fix debug/poll and give new stations a better name from a seed
This commit is contained in:
@@ -33,6 +33,7 @@ QHash< QString, QStringList > Tomahawk::EchonestControl::s_suggestCache = QHash<
|
|||||||
|
|
||||||
Tomahawk::EchonestControl::EchonestControl( const QString& selectedType, const QStringList& typeSelectors, QObject* parent )
|
Tomahawk::EchonestControl::EchonestControl( const QString& selectedType, const QStringList& typeSelectors, QObject* parent )
|
||||||
: DynamicControl ( selectedType.isEmpty() ? "Artist" : selectedType, typeSelectors, parent )
|
: DynamicControl ( selectedType.isEmpty() ? "Artist" : selectedType, typeSelectors, parent )
|
||||||
|
, m_stylePollCount( 0 )
|
||||||
{
|
{
|
||||||
setType( "echonest" );
|
setType( "echonest" );
|
||||||
m_editingTimer.setInterval( 500 ); //timeout to edits
|
m_editingTimer.setInterval( 500 ); //timeout to edits
|
||||||
@@ -721,8 +722,11 @@ Tomahawk::EchonestControl::insertMoodsAndStyles()
|
|||||||
combo->addItem( item, item );
|
combo->addItem( item, item );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( src.isEmpty() ) {
|
if( src.isEmpty() && !combo->count() ) {
|
||||||
QTimer::singleShot( 400, this, SLOT( checkForMoodsOrStylesFetched() ) );
|
if( m_stylePollCount <= 20 ) { // try for 20s to get the styles...
|
||||||
|
QTimer::singleShot( 1000, this, SLOT( checkForMoodsOrStylesFetched() ) );
|
||||||
|
}
|
||||||
|
m_stylePollCount++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,6 +91,7 @@ private:
|
|||||||
|
|
||||||
Echonest::DynamicPlaylist::PlaylistParamData m_data;
|
Echonest::DynamicPlaylist::PlaylistParamData m_data;
|
||||||
QVariant m_cacheData;
|
QVariant m_cacheData;
|
||||||
|
int m_stylePollCount;
|
||||||
|
|
||||||
QSet< QNetworkReply* > m_suggestWorkers;
|
QSet< QNetworkReply* > m_suggestWorkers;
|
||||||
static QHash< QString, QStringList > s_suggestCache;
|
static QHash< QString, QStringList > s_suggestCache;
|
||||||
|
@@ -133,7 +133,8 @@ CategoryAddItem::dropMimeData( const QMimeData* data, Qt::DropAction )
|
|||||||
QTimer::singleShot( 300, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) );
|
QTimer::singleShot( 300, APP->mainWindow()->sourceTreeView(), SLOT( renamePlaylist() ) );
|
||||||
} else if( m_categoryType == SourcesModel::StationsCategory ) {
|
} else if( m_categoryType == SourcesModel::StationsCategory ) {
|
||||||
// seed the playlist with these song filters
|
// seed the playlist with these song filters
|
||||||
dynplaylist_ptr newpl = DynamicPlaylist::create( SourceList::instance()->getLocal(), uuid(), "New Station", "", SourceList::instance()->getLocal()->friendlyName(), OnDemand, false );
|
QString name = queries.isEmpty() ? tr( "New Station" ) : tr( "%1 Station" ).arg( queries.first()->track() );
|
||||||
|
dynplaylist_ptr newpl = DynamicPlaylist::create( SourceList::instance()->getLocal(), uuid(), name, "", SourceList::instance()->getLocal()->friendlyName(), OnDemand, false );
|
||||||
newpl->setMode( OnDemand );
|
newpl->setMode( OnDemand );
|
||||||
|
|
||||||
// now we want to add each query as a song filter...
|
// now we want to add each query as a song filter...
|
||||||
|
Reference in New Issue
Block a user