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:
commit
690a87f1eb
@ -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;
|
||||
},
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,6 +107,7 @@ private:
|
||||
QString m_servicePrettyName;
|
||||
QString m_description;
|
||||
int m_trackCount;
|
||||
int m_weight;
|
||||
QPixmap m_icon;
|
||||
bool m_isOnline;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user