mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02: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:
@@ -1766,6 +1766,9 @@ Tomahawk.Collection = {
|
|||||||
this.settings.capabilities = [Tomahawk.Collection.BrowseCapability.Artists,
|
this.settings.capabilities = [Tomahawk.Collection.BrowseCapability.Artists,
|
||||||
Tomahawk.Collection.BrowseCapability.Albums,
|
Tomahawk.Collection.BrowseCapability.Albums,
|
||||||
Tomahawk.Collection.BrowseCapability.Tracks];
|
Tomahawk.Collection.BrowseCapability.Tracks];
|
||||||
|
if (!this.settings.weight && this.resolver && this.resolver.settings.weight) {
|
||||||
|
this.settings.weight = this.resolver.settings.weight;
|
||||||
|
}
|
||||||
return this.settings;
|
return this.settings;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ ScriptCollection::ScriptCollection( const scriptobject_ptr& scriptObject,
|
|||||||
qDebug() << Q_FUNC_INFO << scriptAccount->name() << Collection::name();
|
qDebug() << Q_FUNC_INFO << scriptAccount->name() << Collection::name();
|
||||||
|
|
||||||
m_servicePrettyName = scriptAccount->name();
|
m_servicePrettyName = scriptAccount->name();
|
||||||
|
m_weight = readMetaData().value( "weight", 99 ).toUInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -360,7 +361,7 @@ ScriptCollection::timeout() const
|
|||||||
unsigned int
|
unsigned int
|
||||||
ScriptCollection::weight() const
|
ScriptCollection::weight() const
|
||||||
{
|
{
|
||||||
return 100;
|
return m_weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -107,6 +107,7 @@ private:
|
|||||||
QString m_servicePrettyName;
|
QString m_servicePrettyName;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
int m_trackCount;
|
int m_trackCount;
|
||||||
|
int m_weight;
|
||||||
QPixmap m_icon;
|
QPixmap m_icon;
|
||||||
bool m_isOnline;
|
bool m_isOnline;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user