mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-01 08:52:45 +00:00
Fix a few bugs and unimplemented features
* Show the now playing cover when playing an item, otherwise show the collection cover. * ItemModelLoaders now correctly expose list properties of non-built-in Qt objects * toString is now implemented for lists, fixing some query construction code. * PlaybackManager now clears the playlist when playing a single item to prevent weird behaviour. * The covers are slightly updated.
This commit is contained in:
parent
60bc90c5fa
commit
caf72af999
19 changed files with 179 additions and 81 deletions
|
@ -139,6 +139,12 @@ QJsonValue toJsonValue(const QSharedPointer<T> &source, convertType<QSharedPoint
|
|||
* Templates for string conversion.
|
||||
*/
|
||||
|
||||
|
||||
template <typename T>
|
||||
QString toString(const T &source) {
|
||||
return toString(source, convertType<T>{});
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QString toString(const T &source, convertType<T>) {
|
||||
return toJsonValue(source).toString();
|
||||
|
@ -154,11 +160,15 @@ QString toString(const std::optional<T> &source, convertType<std::optional<T>>)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
QString toString(const T &source) {
|
||||
return toString(source, convertType<T>{});
|
||||
QString toString(const QList<T> &source, convertType<QList<T>>) {
|
||||
QStringList tmp;
|
||||
tmp.reserve(source.size());
|
||||
for (auto it = source.cbegin(); it != source.cend(); it++) {
|
||||
tmp.append(toString<T>(*it, convertType<T>{}));
|
||||
}
|
||||
return tmp.join(',');
|
||||
}
|
||||
|
||||
|
||||
} // NS Support
|
||||
} // NS Jellyfin
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue