1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-06 10:32:44 +00:00

WIP: HttpLoader seems to work, Model still borked

This commit is contained in:
Chris Josten 2021-03-28 04:00:00 +02:00
parent e421adf733
commit 729e343661
1412 changed files with 13967 additions and 33794 deletions

View file

@ -61,7 +61,7 @@ void AllThemeMediaResult::setFromJson(QJsonObject source) {
}
QJsonObject AllThemeMediaResult::toJson() {
QJsonObject AllThemeMediaResult::toJson() const {
QJsonObject result;
result["ThemeVideosResult"] = Jellyfin::Support::toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeVideosResult);
result["ThemeSongsResult"] = Jellyfin::Support::toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeSongsResult);
@ -96,10 +96,15 @@ namespace Support {
using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult;
template <>
AllThemeMediaResult fromJsonValue<AllThemeMediaResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
AllThemeMediaResult fromJsonValue(const QJsonValue &source, convertType<AllThemeMediaResult>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return AllThemeMediaResult::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const AllThemeMediaResult &source, convertType<AllThemeMediaResult>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin