1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-17 14:28:24 +01:00

Merge pull request #577 from tomahawk-player/scriptcollectionweight

Allow to specify weight for collection (matters only as last resort for sorting results)
This commit is contained in:
Dominik Schmidt 2016-11-30 22:12:10 +01:00 committed by GitHub
commit 690a87f1eb
3 changed files with 6 additions and 1 deletions

View File

@ -1766,6 +1766,9 @@ Tomahawk.Collection = {
this.settings.capabilities = [Tomahawk.Collection.BrowseCapability.Artists,
Tomahawk.Collection.BrowseCapability.Albums,
Tomahawk.Collection.BrowseCapability.Tracks];
if (!this.settings.weight && this.resolver && this.resolver.settings.weight) {
this.settings.weight = this.resolver.settings.weight;
}
return this.settings;
},

View File

@ -53,6 +53,7 @@ ScriptCollection::ScriptCollection( const scriptobject_ptr& scriptObject,
qDebug() << Q_FUNC_INFO << scriptAccount->name() << Collection::name();
m_servicePrettyName = scriptAccount->name();
m_weight = readMetaData().value( "weight", 99 ).toUInt();
}
@ -360,7 +361,7 @@ ScriptCollection::timeout() const
unsigned int
ScriptCollection::weight() const
{
return 100;
return m_weight;
}

View File

@ -107,6 +107,7 @@ private:
QString m_servicePrettyName;
QString m_description;
int m_trackCount;
int m_weight;
QPixmap m_icon;
bool m_isOnline;
};