mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 10:12:46 +00:00
Make model code compileable
This disables some application level logic, but I'm going to rewrite that using Lager anyway.
This commit is contained in:
parent
0358418926
commit
b9b08ab384
551 changed files with 8943 additions and 8809 deletions
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AccessSchedule::AccessSchedule(QObject *parent) {}
|
||||
AccessSchedule::AccessSchedule() {}
|
||||
|
||||
AccessSchedule AccessSchedule::fromJson(QJsonObject source) {AccessSchedule instance;
|
||||
instance->setFromJson(source, false);
|
||||
AccessSchedule AccessSchedule::fromJson(QJsonObject source) {
|
||||
AccessSchedule instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AccessSchedule::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<qint32>(source["Id"]);
|
||||
m_userId = fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_dayOfWeek = fromJsonValue<DynamicDayOfWeek>(source["DayOfWeek"]);
|
||||
m_startHour = fromJsonValue<double>(source["StartHour"]);
|
||||
m_endHour = fromJsonValue<double>(source["EndHour"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<qint32>(source["Id"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_dayOfWeek = Jellyfin::Support::fromJsonValue<DynamicDayOfWeek>(source["DayOfWeek"]);
|
||||
m_startHour = Jellyfin::Support::fromJsonValue<double>(source["StartHour"]);
|
||||
m_endHour = Jellyfin::Support::fromJsonValue<double>(source["EndHour"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AccessSchedule::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<qint32>(m_jellyfinId);
|
||||
result["UserId"] = toJsonValue<QUuid>(m_userId);
|
||||
result["DayOfWeek"] = toJsonValue<DynamicDayOfWeek>(m_dayOfWeek);
|
||||
result["StartHour"] = toJsonValue<double>(m_startHour);
|
||||
result["EndHour"] = toJsonValue<double>(m_endHour);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<qint32>(m_jellyfinId);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_userId);
|
||||
result["DayOfWeek"] = Jellyfin::Support::toJsonValue<DynamicDayOfWeek>(m_dayOfWeek);
|
||||
result["StartHour"] = Jellyfin::Support::toJsonValue<double>(m_startHour);
|
||||
result["EndHour"] = Jellyfin::Support::toJsonValue<double>(m_endHour);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void AccessSchedule::setEndHour(double newEndHour) {
|
|||
m_endHour = newEndHour;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AccessSchedule = Jellyfin::DTO::AccessSchedule;
|
||||
|
||||
template <>
|
||||
AccessSchedule fromJsonValue<AccessSchedule>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AccessSchedule::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,40 +32,41 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ActivityLogEntry::ActivityLogEntry(QObject *parent) {}
|
||||
ActivityLogEntry::ActivityLogEntry() {}
|
||||
|
||||
ActivityLogEntry ActivityLogEntry::fromJson(QJsonObject source) {ActivityLogEntry instance;
|
||||
instance->setFromJson(source, false);
|
||||
ActivityLogEntry ActivityLogEntry::fromJson(QJsonObject source) {
|
||||
ActivityLogEntry instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ActivityLogEntry::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<qint64>(source["Id"]);
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_overview = fromJsonValue<QString>(source["Overview"]);
|
||||
m_shortOverview = fromJsonValue<QString>(source["ShortOverview"]);
|
||||
m_type = fromJsonValue<QString>(source["Type"]);
|
||||
m_itemId = fromJsonValue<QString>(source["ItemId"]);
|
||||
m_date = fromJsonValue<QDateTime>(source["Date"]);
|
||||
m_userId = fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_userPrimaryImageTag = fromJsonValue<QString>(source["UserPrimaryImageTag"]);
|
||||
m_severity = fromJsonValue<LogLevel>(source["Severity"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<qint64>(source["Id"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_overview = Jellyfin::Support::fromJsonValue<QString>(source["Overview"]);
|
||||
m_shortOverview = Jellyfin::Support::fromJsonValue<QString>(source["ShortOverview"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<QString>(source["Type"]);
|
||||
m_itemId = Jellyfin::Support::fromJsonValue<QString>(source["ItemId"]);
|
||||
m_date = Jellyfin::Support::fromJsonValue<QDateTime>(source["Date"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_userPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["UserPrimaryImageTag"]);
|
||||
m_severity = Jellyfin::Support::fromJsonValue<LogLevel>(source["Severity"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ActivityLogEntry::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<qint64>(m_jellyfinId);
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Overview"] = toJsonValue<QString>(m_overview);
|
||||
result["ShortOverview"] = toJsonValue<QString>(m_shortOverview);
|
||||
result["Type"] = toJsonValue<QString>(m_type);
|
||||
result["ItemId"] = toJsonValue<QString>(m_itemId);
|
||||
result["Date"] = toJsonValue<QDateTime>(m_date);
|
||||
result["UserId"] = toJsonValue<QUuid>(m_userId);
|
||||
result["UserPrimaryImageTag"] = toJsonValue<QString>(m_userPrimaryImageTag);
|
||||
result["Severity"] = toJsonValue<LogLevel>(m_severity);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<qint64>(m_jellyfinId);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Overview"] = Jellyfin::Support::toJsonValue<QString>(m_overview);
|
||||
result["ShortOverview"] = Jellyfin::Support::toJsonValue<QString>(m_shortOverview);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
|
||||
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
|
||||
result["Date"] = Jellyfin::Support::toJsonValue<QDateTime>(m_date);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_userId);
|
||||
result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_userPrimaryImageTag);
|
||||
result["Severity"] = Jellyfin::Support::toJsonValue<LogLevel>(m_severity);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -121,6 +122,17 @@ void ActivityLogEntry::setSeverity(LogLevel newSeverity) {
|
|||
m_severity = newSeverity;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ActivityLogEntry = Jellyfin::DTO::ActivityLogEntry;
|
||||
|
||||
template <>
|
||||
ActivityLogEntry fromJsonValue<ActivityLogEntry>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ActivityLogEntry::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ActivityLogEntryQueryResult::ActivityLogEntryQueryResult(QObject *parent) {}
|
||||
ActivityLogEntryQueryResult::ActivityLogEntryQueryResult() {}
|
||||
|
||||
ActivityLogEntryQueryResult ActivityLogEntryQueryResult::fromJson(QJsonObject source) {ActivityLogEntryQueryResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
ActivityLogEntryQueryResult ActivityLogEntryQueryResult::fromJson(QJsonObject source) {
|
||||
ActivityLogEntryQueryResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ActivityLogEntryQueryResult::setFromJson(QJsonObject source) {
|
||||
m_items = fromJsonValue<QList<QSharedPointer<ActivityLogEntry>>>(source["Items"]);
|
||||
m_totalRecordCount = fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_items = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ActivityLogEntry>>>(source["Items"]);
|
||||
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ActivityLogEntryQueryResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Items"] = toJsonValue<QList<QSharedPointer<ActivityLogEntry>>>(m_items);
|
||||
result["TotalRecordCount"] = toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = toJsonValue<qint32>(m_startIndex);
|
||||
result["Items"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ActivityLogEntry>>>(m_items);
|
||||
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void ActivityLogEntryQueryResult::setStartIndex(qint32 newStartIndex) {
|
|||
m_startIndex = newStartIndex;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ActivityLogEntryQueryResult = Jellyfin::DTO::ActivityLogEntryQueryResult;
|
||||
|
||||
template <>
|
||||
ActivityLogEntryQueryResult fromJsonValue<ActivityLogEntryQueryResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ActivityLogEntryQueryResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AddVirtualFolderDto::AddVirtualFolderDto(QObject *parent) {}
|
||||
AddVirtualFolderDto::AddVirtualFolderDto() {}
|
||||
|
||||
AddVirtualFolderDto AddVirtualFolderDto::fromJson(QJsonObject source) {AddVirtualFolderDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
AddVirtualFolderDto AddVirtualFolderDto::fromJson(QJsonObject source) {
|
||||
AddVirtualFolderDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AddVirtualFolderDto::setFromJson(QJsonObject source) {
|
||||
m_libraryOptions = fromJsonValue<QSharedPointer<LibraryOptions>>(source["LibraryOptions"]);
|
||||
m_libraryOptions = Jellyfin::Support::fromJsonValue<QSharedPointer<LibraryOptions>>(source["LibraryOptions"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AddVirtualFolderDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["LibraryOptions"] = toJsonValue<QSharedPointer<LibraryOptions>>(m_libraryOptions);
|
||||
result["LibraryOptions"] = Jellyfin::Support::toJsonValue<QSharedPointer<LibraryOptions>>(m_libraryOptions);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void AddVirtualFolderDto::setLibraryOptions(QSharedPointer<LibraryOptions> newLi
|
|||
m_libraryOptions = newLibraryOptions;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AddVirtualFolderDto = Jellyfin::DTO::AddVirtualFolderDto;
|
||||
|
||||
template <>
|
||||
AddVirtualFolderDto fromJsonValue<AddVirtualFolderDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AddVirtualFolderDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,46 +32,47 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AlbumInfo::AlbumInfo(QObject *parent) {}
|
||||
AlbumInfo::AlbumInfo() {}
|
||||
|
||||
AlbumInfo AlbumInfo::fromJson(QJsonObject source) {AlbumInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
AlbumInfo AlbumInfo::fromJson(QJsonObject source) {
|
||||
AlbumInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AlbumInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_albumArtists = fromJsonValue<QStringList>(source["AlbumArtists"]);
|
||||
m_artistProviderIds = fromJsonValue<QJsonObject>(source["ArtistProviderIds"]);
|
||||
m_songInfos = fromJsonValue<QList<QSharedPointer<SongInfo>>>(source["SongInfos"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = Jellyfin::Support::fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = Jellyfin::Support::fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_albumArtists = Jellyfin::Support::fromJsonValue<QStringList>(source["AlbumArtists"]);
|
||||
m_artistProviderIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ArtistProviderIds"]);
|
||||
m_songInfos = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<SongInfo>>>(source["SongInfos"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AlbumInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = toJsonValue<bool>(m_isAutomated);
|
||||
result["AlbumArtists"] = toJsonValue<QStringList>(m_albumArtists);
|
||||
result["ArtistProviderIds"] = toJsonValue<QJsonObject>(m_artistProviderIds);
|
||||
result["SongInfos"] = toJsonValue<QList<QSharedPointer<SongInfo>>>(m_songInfos);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = Jellyfin::Support::toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
|
||||
result["AlbumArtists"] = Jellyfin::Support::toJsonValue<QStringList>(m_albumArtists);
|
||||
result["ArtistProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_artistProviderIds);
|
||||
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<SongInfo>>>(m_songInfos);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -142,6 +143,17 @@ void AlbumInfo::setSongInfos(QList<QSharedPointer<SongInfo>> newSongInfos) {
|
|||
m_songInfos = newSongInfos;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AlbumInfo = Jellyfin::DTO::AlbumInfo;
|
||||
|
||||
template <>
|
||||
AlbumInfo fromJsonValue<AlbumInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AlbumInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AlbumInfoRemoteSearchQuery::AlbumInfoRemoteSearchQuery(QObject *parent) {}
|
||||
AlbumInfoRemoteSearchQuery::AlbumInfoRemoteSearchQuery() {}
|
||||
|
||||
AlbumInfoRemoteSearchQuery AlbumInfoRemoteSearchQuery::fromJson(QJsonObject source) {AlbumInfoRemoteSearchQuery instance;
|
||||
instance->setFromJson(source, false);
|
||||
AlbumInfoRemoteSearchQuery AlbumInfoRemoteSearchQuery::fromJson(QJsonObject source) {
|
||||
AlbumInfoRemoteSearchQuery instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AlbumInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
|
||||
m_searchInfo = fromJsonValue<QSharedPointer<AlbumInfo>>(source["SearchInfo"]);
|
||||
m_itemId = fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
m_searchInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<AlbumInfo>>(source["SearchInfo"]);
|
||||
m_itemId = Jellyfin::Support::fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = Jellyfin::Support::fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = Jellyfin::Support::fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AlbumInfoRemoteSearchQuery::toJson() {
|
||||
QJsonObject result;
|
||||
result["SearchInfo"] = toJsonValue<QSharedPointer<AlbumInfo>>(m_searchInfo);
|
||||
result["ItemId"] = toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = toJsonValue<bool>(m_includeDisabledProviders);
|
||||
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<AlbumInfo>>(m_searchInfo);
|
||||
result["ItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void AlbumInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisa
|
|||
m_includeDisabledProviders = newIncludeDisabledProviders;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AlbumInfoRemoteSearchQuery = Jellyfin::DTO::AlbumInfoRemoteSearchQuery;
|
||||
|
||||
template <>
|
||||
AlbumInfoRemoteSearchQuery fromJsonValue<AlbumInfoRemoteSearchQuery>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AlbumInfoRemoteSearchQuery::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AllThemeMediaResult::AllThemeMediaResult(QObject *parent) {}
|
||||
AllThemeMediaResult::AllThemeMediaResult() {}
|
||||
|
||||
AllThemeMediaResult AllThemeMediaResult::fromJson(QJsonObject source) {AllThemeMediaResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
AllThemeMediaResult AllThemeMediaResult::fromJson(QJsonObject source) {
|
||||
AllThemeMediaResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AllThemeMediaResult::setFromJson(QJsonObject source) {
|
||||
m_themeVideosResult = fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["ThemeVideosResult"]);
|
||||
m_themeSongsResult = fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["ThemeSongsResult"]);
|
||||
m_soundtrackSongsResult = fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["SoundtrackSongsResult"]);
|
||||
m_themeVideosResult = Jellyfin::Support::fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["ThemeVideosResult"]);
|
||||
m_themeSongsResult = Jellyfin::Support::fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["ThemeSongsResult"]);
|
||||
m_soundtrackSongsResult = Jellyfin::Support::fromJsonValue<QSharedPointer<ThemeMediaResult>>(source["SoundtrackSongsResult"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AllThemeMediaResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["ThemeVideosResult"] = toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeVideosResult);
|
||||
result["ThemeSongsResult"] = toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeSongsResult);
|
||||
result["SoundtrackSongsResult"] = toJsonValue<QSharedPointer<ThemeMediaResult>>(m_soundtrackSongsResult);
|
||||
result["ThemeVideosResult"] = Jellyfin::Support::toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeVideosResult);
|
||||
result["ThemeSongsResult"] = Jellyfin::Support::toJsonValue<QSharedPointer<ThemeMediaResult>>(m_themeSongsResult);
|
||||
result["SoundtrackSongsResult"] = Jellyfin::Support::toJsonValue<QSharedPointer<ThemeMediaResult>>(m_soundtrackSongsResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void AllThemeMediaResult::setSoundtrackSongsResult(QSharedPointer<ThemeMediaResu
|
|||
m_soundtrackSongsResult = newSoundtrackSongsResult;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult;
|
||||
|
||||
template <>
|
||||
AllThemeMediaResult fromJsonValue<AllThemeMediaResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AllThemeMediaResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,36 @@ namespace DTO {
|
|||
|
||||
ArchitectureClass::ArchitectureClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using Architecture = Jellyfin::DTO::Architecture;
|
||||
|
||||
template <>
|
||||
Architecture fromJsonValue<Architecture>(const QJsonValue &source) {
|
||||
if (!source.isString()) return Architecture::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("X86")) {
|
||||
return Architecture::X86;
|
||||
}
|
||||
if (str == QStringLiteral("X64")) {
|
||||
return Architecture::X64;
|
||||
}
|
||||
if (str == QStringLiteral("Arm")) {
|
||||
return Architecture::Arm;
|
||||
}
|
||||
if (str == QStringLiteral("Arm64")) {
|
||||
return Architecture::Arm64;
|
||||
}
|
||||
if (str == QStringLiteral("Wasm")) {
|
||||
return Architecture::Wasm;
|
||||
}
|
||||
|
||||
return Architecture::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,42 +32,43 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ArtistInfo::ArtistInfo(QObject *parent) {}
|
||||
ArtistInfo::ArtistInfo() {}
|
||||
|
||||
ArtistInfo ArtistInfo::fromJson(QJsonObject source) {ArtistInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ArtistInfo ArtistInfo::fromJson(QJsonObject source) {
|
||||
ArtistInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ArtistInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_songInfos = fromJsonValue<QList<QSharedPointer<SongInfo>>>(source["SongInfos"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = Jellyfin::Support::fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = Jellyfin::Support::fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_songInfos = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<SongInfo>>>(source["SongInfos"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ArtistInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = toJsonValue<bool>(m_isAutomated);
|
||||
result["SongInfos"] = toJsonValue<QList<QSharedPointer<SongInfo>>>(m_songInfos);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = Jellyfin::Support::toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
|
||||
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<SongInfo>>>(m_songInfos);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -128,6 +129,17 @@ void ArtistInfo::setSongInfos(QList<QSharedPointer<SongInfo>> newSongInfos) {
|
|||
m_songInfos = newSongInfos;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ArtistInfo = Jellyfin::DTO::ArtistInfo;
|
||||
|
||||
template <>
|
||||
ArtistInfo fromJsonValue<ArtistInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ArtistInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ArtistInfoRemoteSearchQuery::ArtistInfoRemoteSearchQuery(QObject *parent) {}
|
||||
ArtistInfoRemoteSearchQuery::ArtistInfoRemoteSearchQuery() {}
|
||||
|
||||
ArtistInfoRemoteSearchQuery ArtistInfoRemoteSearchQuery::fromJson(QJsonObject source) {ArtistInfoRemoteSearchQuery instance;
|
||||
instance->setFromJson(source, false);
|
||||
ArtistInfoRemoteSearchQuery ArtistInfoRemoteSearchQuery::fromJson(QJsonObject source) {
|
||||
ArtistInfoRemoteSearchQuery instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ArtistInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
|
||||
m_searchInfo = fromJsonValue<QSharedPointer<ArtistInfo>>(source["SearchInfo"]);
|
||||
m_itemId = fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
m_searchInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<ArtistInfo>>(source["SearchInfo"]);
|
||||
m_itemId = Jellyfin::Support::fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = Jellyfin::Support::fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = Jellyfin::Support::fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ArtistInfoRemoteSearchQuery::toJson() {
|
||||
QJsonObject result;
|
||||
result["SearchInfo"] = toJsonValue<QSharedPointer<ArtistInfo>>(m_searchInfo);
|
||||
result["ItemId"] = toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = toJsonValue<bool>(m_includeDisabledProviders);
|
||||
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<ArtistInfo>>(m_searchInfo);
|
||||
result["ItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void ArtistInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDis
|
|||
m_includeDisabledProviders = newIncludeDisabledProviders;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ArtistInfoRemoteSearchQuery = Jellyfin::DTO::ArtistInfoRemoteSearchQuery;
|
||||
|
||||
template <>
|
||||
ArtistInfoRemoteSearchQuery fromJsonValue<ArtistInfoRemoteSearchQuery>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ArtistInfoRemoteSearchQuery::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AuthenticateUserByName::AuthenticateUserByName(QObject *parent) {}
|
||||
AuthenticateUserByName::AuthenticateUserByName() {}
|
||||
|
||||
AuthenticateUserByName AuthenticateUserByName::fromJson(QJsonObject source) {AuthenticateUserByName instance;
|
||||
instance->setFromJson(source, false);
|
||||
AuthenticateUserByName AuthenticateUserByName::fromJson(QJsonObject source) {
|
||||
AuthenticateUserByName instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AuthenticateUserByName::setFromJson(QJsonObject source) {
|
||||
m_username = fromJsonValue<QString>(source["Username"]);
|
||||
m_pw = fromJsonValue<QString>(source["Pw"]);
|
||||
m_password = fromJsonValue<QString>(source["Password"]);
|
||||
m_username = Jellyfin::Support::fromJsonValue<QString>(source["Username"]);
|
||||
m_pw = Jellyfin::Support::fromJsonValue<QString>(source["Pw"]);
|
||||
m_password = Jellyfin::Support::fromJsonValue<QString>(source["Password"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AuthenticateUserByName::toJson() {
|
||||
QJsonObject result;
|
||||
result["Username"] = toJsonValue<QString>(m_username);
|
||||
result["Pw"] = toJsonValue<QString>(m_pw);
|
||||
result["Password"] = toJsonValue<QString>(m_password);
|
||||
result["Username"] = Jellyfin::Support::toJsonValue<QString>(m_username);
|
||||
result["Pw"] = Jellyfin::Support::toJsonValue<QString>(m_pw);
|
||||
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void AuthenticateUserByName::setPassword(QString newPassword) {
|
|||
m_password = newPassword;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AuthenticateUserByName = Jellyfin::DTO::AuthenticateUserByName;
|
||||
|
||||
template <>
|
||||
AuthenticateUserByName fromJsonValue<AuthenticateUserByName>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AuthenticateUserByName::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,44 +32,45 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AuthenticationInfo::AuthenticationInfo(QObject *parent) {}
|
||||
AuthenticationInfo::AuthenticationInfo() {}
|
||||
|
||||
AuthenticationInfo AuthenticationInfo::fromJson(QJsonObject source) {AuthenticationInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
AuthenticationInfo AuthenticationInfo::fromJson(QJsonObject source) {
|
||||
AuthenticationInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AuthenticationInfo::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<qint64>(source["Id"]);
|
||||
m_accessToken = fromJsonValue<QString>(source["AccessToken"]);
|
||||
m_deviceId = fromJsonValue<QString>(source["DeviceId"]);
|
||||
m_appName = fromJsonValue<QString>(source["AppName"]);
|
||||
m_appVersion = fromJsonValue<QString>(source["AppVersion"]);
|
||||
m_deviceName = fromJsonValue<QString>(source["DeviceName"]);
|
||||
m_userId = fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_isActive = fromJsonValue<bool>(source["IsActive"]);
|
||||
m_dateCreated = fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateRevoked = fromJsonValue<QDateTime>(source["DateRevoked"]);
|
||||
m_dateLastActivity = fromJsonValue<QDateTime>(source["DateLastActivity"]);
|
||||
m_userName = fromJsonValue<QString>(source["UserName"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<qint64>(source["Id"]);
|
||||
m_accessToken = Jellyfin::Support::fromJsonValue<QString>(source["AccessToken"]);
|
||||
m_deviceId = Jellyfin::Support::fromJsonValue<QString>(source["DeviceId"]);
|
||||
m_appName = Jellyfin::Support::fromJsonValue<QString>(source["AppName"]);
|
||||
m_appVersion = Jellyfin::Support::fromJsonValue<QString>(source["AppVersion"]);
|
||||
m_deviceName = Jellyfin::Support::fromJsonValue<QString>(source["DeviceName"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_isActive = Jellyfin::Support::fromJsonValue<bool>(source["IsActive"]);
|
||||
m_dateCreated = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateRevoked = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateRevoked"]);
|
||||
m_dateLastActivity = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastActivity"]);
|
||||
m_userName = Jellyfin::Support::fromJsonValue<QString>(source["UserName"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AuthenticationInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<qint64>(m_jellyfinId);
|
||||
result["AccessToken"] = toJsonValue<QString>(m_accessToken);
|
||||
result["DeviceId"] = toJsonValue<QString>(m_deviceId);
|
||||
result["AppName"] = toJsonValue<QString>(m_appName);
|
||||
result["AppVersion"] = toJsonValue<QString>(m_appVersion);
|
||||
result["DeviceName"] = toJsonValue<QString>(m_deviceName);
|
||||
result["UserId"] = toJsonValue<QUuid>(m_userId);
|
||||
result["IsActive"] = toJsonValue<bool>(m_isActive);
|
||||
result["DateCreated"] = toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateRevoked"] = toJsonValue<QDateTime>(m_dateRevoked);
|
||||
result["DateLastActivity"] = toJsonValue<QDateTime>(m_dateLastActivity);
|
||||
result["UserName"] = toJsonValue<QString>(m_userName);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<qint64>(m_jellyfinId);
|
||||
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
|
||||
result["DeviceId"] = Jellyfin::Support::toJsonValue<QString>(m_deviceId);
|
||||
result["AppName"] = Jellyfin::Support::toJsonValue<QString>(m_appName);
|
||||
result["AppVersion"] = Jellyfin::Support::toJsonValue<QString>(m_appVersion);
|
||||
result["DeviceName"] = Jellyfin::Support::toJsonValue<QString>(m_deviceName);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_userId);
|
||||
result["IsActive"] = Jellyfin::Support::toJsonValue<bool>(m_isActive);
|
||||
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateRevoked"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateRevoked);
|
||||
result["DateLastActivity"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastActivity);
|
||||
result["UserName"] = Jellyfin::Support::toJsonValue<QString>(m_userName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -135,6 +136,17 @@ void AuthenticationInfo::setUserName(QString newUserName) {
|
|||
m_userName = newUserName;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AuthenticationInfo = Jellyfin::DTO::AuthenticationInfo;
|
||||
|
||||
template <>
|
||||
AuthenticationInfo fromJsonValue<AuthenticationInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AuthenticationInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AuthenticationInfoQueryResult::AuthenticationInfoQueryResult(QObject *parent) {}
|
||||
AuthenticationInfoQueryResult::AuthenticationInfoQueryResult() {}
|
||||
|
||||
AuthenticationInfoQueryResult AuthenticationInfoQueryResult::fromJson(QJsonObject source) {AuthenticationInfoQueryResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
AuthenticationInfoQueryResult AuthenticationInfoQueryResult::fromJson(QJsonObject source) {
|
||||
AuthenticationInfoQueryResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AuthenticationInfoQueryResult::setFromJson(QJsonObject source) {
|
||||
m_items = fromJsonValue<QList<QSharedPointer<AuthenticationInfo>>>(source["Items"]);
|
||||
m_totalRecordCount = fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_items = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<AuthenticationInfo>>>(source["Items"]);
|
||||
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AuthenticationInfoQueryResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Items"] = toJsonValue<QList<QSharedPointer<AuthenticationInfo>>>(m_items);
|
||||
result["TotalRecordCount"] = toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = toJsonValue<qint32>(m_startIndex);
|
||||
result["Items"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<AuthenticationInfo>>>(m_items);
|
||||
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void AuthenticationInfoQueryResult::setStartIndex(qint32 newStartIndex) {
|
|||
m_startIndex = newStartIndex;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AuthenticationInfoQueryResult = Jellyfin::DTO::AuthenticationInfoQueryResult;
|
||||
|
||||
template <>
|
||||
AuthenticationInfoQueryResult fromJsonValue<AuthenticationInfoQueryResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AuthenticationInfoQueryResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
AuthenticationResult::AuthenticationResult(QObject *parent) {}
|
||||
AuthenticationResult::AuthenticationResult() {}
|
||||
|
||||
AuthenticationResult AuthenticationResult::fromJson(QJsonObject source) {AuthenticationResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
AuthenticationResult AuthenticationResult::fromJson(QJsonObject source) {
|
||||
AuthenticationResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void AuthenticationResult::setFromJson(QJsonObject source) {
|
||||
m_user = fromJsonValue<QSharedPointer<UserDto>>(source["User"]);
|
||||
m_sessionInfo = fromJsonValue<QSharedPointer<SessionInfo>>(source["SessionInfo"]);
|
||||
m_accessToken = fromJsonValue<QString>(source["AccessToken"]);
|
||||
m_serverId = fromJsonValue<QString>(source["ServerId"]);
|
||||
m_user = Jellyfin::Support::fromJsonValue<QSharedPointer<UserDto>>(source["User"]);
|
||||
m_sessionInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<SessionInfo>>(source["SessionInfo"]);
|
||||
m_accessToken = Jellyfin::Support::fromJsonValue<QString>(source["AccessToken"]);
|
||||
m_serverId = Jellyfin::Support::fromJsonValue<QString>(source["ServerId"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject AuthenticationResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["User"] = toJsonValue<QSharedPointer<UserDto>>(m_user);
|
||||
result["SessionInfo"] = toJsonValue<QSharedPointer<SessionInfo>>(m_sessionInfo);
|
||||
result["AccessToken"] = toJsonValue<QString>(m_accessToken);
|
||||
result["ServerId"] = toJsonValue<QString>(m_serverId);
|
||||
result["User"] = Jellyfin::Support::toJsonValue<QSharedPointer<UserDto>>(m_user);
|
||||
result["SessionInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<SessionInfo>>(m_sessionInfo);
|
||||
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
|
||||
result["ServerId"] = Jellyfin::Support::toJsonValue<QString>(m_serverId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void AuthenticationResult::setServerId(QString newServerId) {
|
|||
m_serverId = newServerId;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using AuthenticationResult = Jellyfin::DTO::AuthenticationResult;
|
||||
|
||||
template <>
|
||||
AuthenticationResult fromJsonValue<AuthenticationResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return AuthenticationResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,42 +32,43 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BaseItem::BaseItem(QObject *parent) {}
|
||||
BaseItem::BaseItem() {}
|
||||
|
||||
BaseItem BaseItem::fromJson(QJsonObject source) {BaseItem instance;
|
||||
instance->setFromJson(source, false);
|
||||
BaseItem BaseItem::fromJson(QJsonObject source) {
|
||||
BaseItem instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BaseItem::setFromJson(QJsonObject source) {
|
||||
m_size = fromJsonValue<qint64>(source["Size"]);
|
||||
m_container = fromJsonValue<QString>(source["Container"]);
|
||||
m_dateLastSaved = fromJsonValue<QDateTime>(source["DateLastSaved"]);
|
||||
m_remoteTrailers = fromJsonValue<QList<QSharedPointer<MediaUrl>>>(source["RemoteTrailers"]);
|
||||
m_isHD = fromJsonValue<bool>(source["IsHD"]);
|
||||
m_isShortcut = fromJsonValue<bool>(source["IsShortcut"]);
|
||||
m_shortcutPath = fromJsonValue<QString>(source["ShortcutPath"]);
|
||||
m_width = fromJsonValue<qint32>(source["Width"]);
|
||||
m_height = fromJsonValue<qint32>(source["Height"]);
|
||||
m_extraIds = fromJsonValue<QList<QUuid>>(source["ExtraIds"]);
|
||||
m_supportsExternalTransfer = fromJsonValue<bool>(source["SupportsExternalTransfer"]);
|
||||
m_size = Jellyfin::Support::fromJsonValue<qint64>(source["Size"]);
|
||||
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
|
||||
m_dateLastSaved = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastSaved"]);
|
||||
m_remoteTrailers = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<MediaUrl>>>(source["RemoteTrailers"]);
|
||||
m_isHD = Jellyfin::Support::fromJsonValue<bool>(source["IsHD"]);
|
||||
m_isShortcut = Jellyfin::Support::fromJsonValue<bool>(source["IsShortcut"]);
|
||||
m_shortcutPath = Jellyfin::Support::fromJsonValue<QString>(source["ShortcutPath"]);
|
||||
m_width = Jellyfin::Support::fromJsonValue<qint32>(source["Width"]);
|
||||
m_height = Jellyfin::Support::fromJsonValue<qint32>(source["Height"]);
|
||||
m_extraIds = Jellyfin::Support::fromJsonValue<QList<QUuid>>(source["ExtraIds"]);
|
||||
m_supportsExternalTransfer = Jellyfin::Support::fromJsonValue<bool>(source["SupportsExternalTransfer"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BaseItem::toJson() {
|
||||
QJsonObject result;
|
||||
result["Size"] = toJsonValue<qint64>(m_size);
|
||||
result["Container"] = toJsonValue<QString>(m_container);
|
||||
result["DateLastSaved"] = toJsonValue<QDateTime>(m_dateLastSaved);
|
||||
result["RemoteTrailers"] = toJsonValue<QList<QSharedPointer<MediaUrl>>>(m_remoteTrailers);
|
||||
result["IsHD"] = toJsonValue<bool>(m_isHD);
|
||||
result["IsShortcut"] = toJsonValue<bool>(m_isShortcut);
|
||||
result["ShortcutPath"] = toJsonValue<QString>(m_shortcutPath);
|
||||
result["Width"] = toJsonValue<qint32>(m_width);
|
||||
result["Height"] = toJsonValue<qint32>(m_height);
|
||||
result["ExtraIds"] = toJsonValue<QList<QUuid>>(m_extraIds);
|
||||
result["SupportsExternalTransfer"] = toJsonValue<bool>(m_supportsExternalTransfer);
|
||||
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
|
||||
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
|
||||
result["DateLastSaved"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastSaved);
|
||||
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<MediaUrl>>>(m_remoteTrailers);
|
||||
result["IsHD"] = Jellyfin::Support::toJsonValue<bool>(m_isHD);
|
||||
result["IsShortcut"] = Jellyfin::Support::toJsonValue<bool>(m_isShortcut);
|
||||
result["ShortcutPath"] = Jellyfin::Support::toJsonValue<QString>(m_shortcutPath);
|
||||
result["Width"] = Jellyfin::Support::toJsonValue<qint32>(m_width);
|
||||
result["Height"] = Jellyfin::Support::toJsonValue<qint32>(m_height);
|
||||
result["ExtraIds"] = Jellyfin::Support::toJsonValue<QList<QUuid>>(m_extraIds);
|
||||
result["SupportsExternalTransfer"] = Jellyfin::Support::toJsonValue<bool>(m_supportsExternalTransfer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -128,6 +129,17 @@ void BaseItem::setSupportsExternalTransfer(bool newSupportsExternalTransfer) {
|
|||
m_supportsExternalTransfer = newSupportsExternalTransfer;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BaseItem = Jellyfin::DTO::BaseItem;
|
||||
|
||||
template <>
|
||||
BaseItem fromJsonValue<BaseItem>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BaseItem::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,322 +32,323 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BaseItemDto::BaseItemDto(QObject *parent) {}
|
||||
BaseItemDto::BaseItemDto() {}
|
||||
|
||||
BaseItemDto BaseItemDto::fromJson(QJsonObject source) {BaseItemDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
BaseItemDto BaseItemDto::fromJson(QJsonObject source) {
|
||||
BaseItemDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BaseItemDto::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_originalTitle = fromJsonValue<QString>(source["OriginalTitle"]);
|
||||
m_serverId = fromJsonValue<QString>(source["ServerId"]);
|
||||
m_jellyfinId = fromJsonValue<QUuid>(source["Id"]);
|
||||
m_etag = fromJsonValue<QString>(source["Etag"]);
|
||||
m_sourceType = fromJsonValue<QString>(source["SourceType"]);
|
||||
m_playlistItemId = fromJsonValue<QString>(source["PlaylistItemId"]);
|
||||
m_dateCreated = fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateLastMediaAdded = fromJsonValue<QDateTime>(source["DateLastMediaAdded"]);
|
||||
m_extraType = fromJsonValue<QString>(source["ExtraType"]);
|
||||
m_airsBeforeSeasonNumber = fromJsonValue<qint32>(source["AirsBeforeSeasonNumber"]);
|
||||
m_airsAfterSeasonNumber = fromJsonValue<qint32>(source["AirsAfterSeasonNumber"]);
|
||||
m_airsBeforeEpisodeNumber = fromJsonValue<qint32>(source["AirsBeforeEpisodeNumber"]);
|
||||
m_canDelete = fromJsonValue<bool>(source["CanDelete"]);
|
||||
m_canDownload = fromJsonValue<bool>(source["CanDownload"]);
|
||||
m_hasSubtitles = fromJsonValue<bool>(source["HasSubtitles"]);
|
||||
m_preferredMetadataLanguage = fromJsonValue<QString>(source["PreferredMetadataLanguage"]);
|
||||
m_preferredMetadataCountryCode = fromJsonValue<QString>(source["PreferredMetadataCountryCode"]);
|
||||
m_supportsSync = fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_container = fromJsonValue<QString>(source["Container"]);
|
||||
m_sortName = fromJsonValue<QString>(source["SortName"]);
|
||||
m_forcedSortName = fromJsonValue<QString>(source["ForcedSortName"]);
|
||||
m_video3DFormat = fromJsonValue<Video3DFormat>(source["Video3DFormat"]);
|
||||
m_premiereDate = fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_externalUrls = fromJsonValue<QList<QSharedPointer<ExternalUrl>>>(source["ExternalUrls"]);
|
||||
m_mediaSources = fromJsonValue<QList<QSharedPointer<MediaSourceInfo>>>(source["MediaSources"]);
|
||||
m_criticRating = fromJsonValue<float>(source["CriticRating"]);
|
||||
m_productionLocations = fromJsonValue<QStringList>(source["ProductionLocations"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_enableMediaSourceDisplay = fromJsonValue<bool>(source["EnableMediaSourceDisplay"]);
|
||||
m_officialRating = fromJsonValue<QString>(source["OfficialRating"]);
|
||||
m_customRating = fromJsonValue<QString>(source["CustomRating"]);
|
||||
m_channelId = fromJsonValue<QUuid>(source["ChannelId"]);
|
||||
m_channelName = fromJsonValue<QString>(source["ChannelName"]);
|
||||
m_overview = fromJsonValue<QString>(source["Overview"]);
|
||||
m_taglines = fromJsonValue<QStringList>(source["Taglines"]);
|
||||
m_genres = fromJsonValue<QStringList>(source["Genres"]);
|
||||
m_communityRating = fromJsonValue<float>(source["CommunityRating"]);
|
||||
m_cumulativeRunTimeTicks = fromJsonValue<qint64>(source["CumulativeRunTimeTicks"]);
|
||||
m_runTimeTicks = fromJsonValue<qint64>(source["RunTimeTicks"]);
|
||||
m_playAccess = fromJsonValue<PlayAccess>(source["PlayAccess"]);
|
||||
m_aspectRatio = fromJsonValue<QString>(source["AspectRatio"]);
|
||||
m_productionYear = fromJsonValue<qint32>(source["ProductionYear"]);
|
||||
m_isPlaceHolder = fromJsonValue<bool>(source["IsPlaceHolder"]);
|
||||
m_number = fromJsonValue<QString>(source["Number"]);
|
||||
m_channelNumber = fromJsonValue<QString>(source["ChannelNumber"]);
|
||||
m_indexNumber = fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_indexNumberEnd = fromJsonValue<qint32>(source["IndexNumberEnd"]);
|
||||
m_parentIndexNumber = fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_remoteTrailers = fromJsonValue<QList<QSharedPointer<MediaUrl>>>(source["RemoteTrailers"]);
|
||||
m_providerIds = fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_isHD = fromJsonValue<bool>(source["IsHD"]);
|
||||
m_isFolder = fromJsonValue<bool>(source["IsFolder"]);
|
||||
m_parentId = fromJsonValue<QUuid>(source["ParentId"]);
|
||||
m_type = fromJsonValue<QString>(source["Type"]);
|
||||
m_people = fromJsonValue<QList<QSharedPointer<BaseItemPerson>>>(source["People"]);
|
||||
m_studios = fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["Studios"]);
|
||||
m_genreItems = fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["GenreItems"]);
|
||||
m_parentLogoItemId = fromJsonValue<QString>(source["ParentLogoItemId"]);
|
||||
m_parentBackdropItemId = fromJsonValue<QString>(source["ParentBackdropItemId"]);
|
||||
m_parentBackdropImageTags = fromJsonValue<QStringList>(source["ParentBackdropImageTags"]);
|
||||
m_localTrailerCount = fromJsonValue<qint32>(source["LocalTrailerCount"]);
|
||||
m_userData = fromJsonValue<QSharedPointer<UserItemDataDto>>(source["UserData"]);
|
||||
m_recursiveItemCount = fromJsonValue<qint32>(source["RecursiveItemCount"]);
|
||||
m_childCount = fromJsonValue<qint32>(source["ChildCount"]);
|
||||
m_seriesName = fromJsonValue<QString>(source["SeriesName"]);
|
||||
m_seriesId = fromJsonValue<QUuid>(source["SeriesId"]);
|
||||
m_seasonId = fromJsonValue<QUuid>(source["SeasonId"]);
|
||||
m_specialFeatureCount = fromJsonValue<qint32>(source["SpecialFeatureCount"]);
|
||||
m_displayPreferencesId = fromJsonValue<QString>(source["DisplayPreferencesId"]);
|
||||
m_status = fromJsonValue<QString>(source["Status"]);
|
||||
m_airTime = fromJsonValue<QString>(source["AirTime"]);
|
||||
m_airDays = fromJsonValue<QList<DayOfWeek>>(source["AirDays"]);
|
||||
m_tags = fromJsonValue<QStringList>(source["Tags"]);
|
||||
m_primaryImageAspectRatio = fromJsonValue<double>(source["PrimaryImageAspectRatio"]);
|
||||
m_artists = fromJsonValue<QStringList>(source["Artists"]);
|
||||
m_artistItems = fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["ArtistItems"]);
|
||||
m_album = fromJsonValue<QString>(source["Album"]);
|
||||
m_collectionType = fromJsonValue<QString>(source["CollectionType"]);
|
||||
m_displayOrder = fromJsonValue<QString>(source["DisplayOrder"]);
|
||||
m_albumId = fromJsonValue<QUuid>(source["AlbumId"]);
|
||||
m_albumPrimaryImageTag = fromJsonValue<QString>(source["AlbumPrimaryImageTag"]);
|
||||
m_seriesPrimaryImageTag = fromJsonValue<QString>(source["SeriesPrimaryImageTag"]);
|
||||
m_albumArtist = fromJsonValue<QString>(source["AlbumArtist"]);
|
||||
m_albumArtists = fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["AlbumArtists"]);
|
||||
m_seasonName = fromJsonValue<QString>(source["SeasonName"]);
|
||||
m_mediaStreams = fromJsonValue<QList<QSharedPointer<MediaStream>>>(source["MediaStreams"]);
|
||||
m_videoType = fromJsonValue<VideoType>(source["VideoType"]);
|
||||
m_partCount = fromJsonValue<qint32>(source["PartCount"]);
|
||||
m_mediaSourceCount = fromJsonValue<qint32>(source["MediaSourceCount"]);
|
||||
m_imageTags = fromJsonValue<QJsonObject>(source["ImageTags"]);
|
||||
m_backdropImageTags = fromJsonValue<QStringList>(source["BackdropImageTags"]);
|
||||
m_screenshotImageTags = fromJsonValue<QStringList>(source["ScreenshotImageTags"]);
|
||||
m_parentLogoImageTag = fromJsonValue<QString>(source["ParentLogoImageTag"]);
|
||||
m_parentArtItemId = fromJsonValue<QString>(source["ParentArtItemId"]);
|
||||
m_parentArtImageTag = fromJsonValue<QString>(source["ParentArtImageTag"]);
|
||||
m_seriesThumbImageTag = fromJsonValue<QString>(source["SeriesThumbImageTag"]);
|
||||
m_imageBlurHashes = fromJsonValue<QJsonObject>(source["ImageBlurHashes"]);
|
||||
m_seriesStudio = fromJsonValue<QString>(source["SeriesStudio"]);
|
||||
m_parentThumbItemId = fromJsonValue<QString>(source["ParentThumbItemId"]);
|
||||
m_parentThumbImageTag = fromJsonValue<QString>(source["ParentThumbImageTag"]);
|
||||
m_parentPrimaryImageItemId = fromJsonValue<QString>(source["ParentPrimaryImageItemId"]);
|
||||
m_parentPrimaryImageTag = fromJsonValue<QString>(source["ParentPrimaryImageTag"]);
|
||||
m_chapters = fromJsonValue<QList<QSharedPointer<ChapterInfo>>>(source["Chapters"]);
|
||||
m_locationType = fromJsonValue<LocationType>(source["LocationType"]);
|
||||
m_isoType = fromJsonValue<IsoType>(source["IsoType"]);
|
||||
m_mediaType = fromJsonValue<QString>(source["MediaType"]);
|
||||
m_endDate = fromJsonValue<QDateTime>(source["EndDate"]);
|
||||
m_lockedFields = fromJsonValue<QList<MetadataField>>(source["LockedFields"]);
|
||||
m_trailerCount = fromJsonValue<qint32>(source["TrailerCount"]);
|
||||
m_movieCount = fromJsonValue<qint32>(source["MovieCount"]);
|
||||
m_seriesCount = fromJsonValue<qint32>(source["SeriesCount"]);
|
||||
m_programCount = fromJsonValue<qint32>(source["ProgramCount"]);
|
||||
m_episodeCount = fromJsonValue<qint32>(source["EpisodeCount"]);
|
||||
m_songCount = fromJsonValue<qint32>(source["SongCount"]);
|
||||
m_albumCount = fromJsonValue<qint32>(source["AlbumCount"]);
|
||||
m_artistCount = fromJsonValue<qint32>(source["ArtistCount"]);
|
||||
m_musicVideoCount = fromJsonValue<qint32>(source["MusicVideoCount"]);
|
||||
m_lockData = fromJsonValue<bool>(source["LockData"]);
|
||||
m_width = fromJsonValue<qint32>(source["Width"]);
|
||||
m_height = fromJsonValue<qint32>(source["Height"]);
|
||||
m_cameraMake = fromJsonValue<QString>(source["CameraMake"]);
|
||||
m_cameraModel = fromJsonValue<QString>(source["CameraModel"]);
|
||||
m_software = fromJsonValue<QString>(source["Software"]);
|
||||
m_exposureTime = fromJsonValue<double>(source["ExposureTime"]);
|
||||
m_focalLength = fromJsonValue<double>(source["FocalLength"]);
|
||||
m_imageOrientation = fromJsonValue<ImageOrientation>(source["ImageOrientation"]);
|
||||
m_aperture = fromJsonValue<double>(source["Aperture"]);
|
||||
m_shutterSpeed = fromJsonValue<double>(source["ShutterSpeed"]);
|
||||
m_latitude = fromJsonValue<double>(source["Latitude"]);
|
||||
m_longitude = fromJsonValue<double>(source["Longitude"]);
|
||||
m_altitude = fromJsonValue<double>(source["Altitude"]);
|
||||
m_isoSpeedRating = fromJsonValue<qint32>(source["IsoSpeedRating"]);
|
||||
m_seriesTimerId = fromJsonValue<QString>(source["SeriesTimerId"]);
|
||||
m_programId = fromJsonValue<QString>(source["ProgramId"]);
|
||||
m_channelPrimaryImageTag = fromJsonValue<QString>(source["ChannelPrimaryImageTag"]);
|
||||
m_startDate = fromJsonValue<QDateTime>(source["StartDate"]);
|
||||
m_completionPercentage = fromJsonValue<double>(source["CompletionPercentage"]);
|
||||
m_isRepeat = fromJsonValue<bool>(source["IsRepeat"]);
|
||||
m_episodeTitle = fromJsonValue<QString>(source["EpisodeTitle"]);
|
||||
m_channelType = fromJsonValue<ChannelType>(source["ChannelType"]);
|
||||
m_audio = fromJsonValue<ProgramAudio>(source["Audio"]);
|
||||
m_isMovie = fromJsonValue<bool>(source["IsMovie"]);
|
||||
m_isSports = fromJsonValue<bool>(source["IsSports"]);
|
||||
m_isSeries = fromJsonValue<bool>(source["IsSeries"]);
|
||||
m_isLive = fromJsonValue<bool>(source["IsLive"]);
|
||||
m_isNews = fromJsonValue<bool>(source["IsNews"]);
|
||||
m_isKids = fromJsonValue<bool>(source["IsKids"]);
|
||||
m_isPremiere = fromJsonValue<bool>(source["IsPremiere"]);
|
||||
m_timerId = fromJsonValue<QString>(source["TimerId"]);
|
||||
m_currentProgram = fromJsonValue<QSharedPointer<BaseItemDto>>(source["CurrentProgram"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_originalTitle = Jellyfin::Support::fromJsonValue<QString>(source["OriginalTitle"]);
|
||||
m_serverId = Jellyfin::Support::fromJsonValue<QString>(source["ServerId"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QUuid>(source["Id"]);
|
||||
m_etag = Jellyfin::Support::fromJsonValue<QString>(source["Etag"]);
|
||||
m_sourceType = Jellyfin::Support::fromJsonValue<QString>(source["SourceType"]);
|
||||
m_playlistItemId = Jellyfin::Support::fromJsonValue<QString>(source["PlaylistItemId"]);
|
||||
m_dateCreated = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateLastMediaAdded = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastMediaAdded"]);
|
||||
m_extraType = Jellyfin::Support::fromJsonValue<QString>(source["ExtraType"]);
|
||||
m_airsBeforeSeasonNumber = Jellyfin::Support::fromJsonValue<qint32>(source["AirsBeforeSeasonNumber"]);
|
||||
m_airsAfterSeasonNumber = Jellyfin::Support::fromJsonValue<qint32>(source["AirsAfterSeasonNumber"]);
|
||||
m_airsBeforeEpisodeNumber = Jellyfin::Support::fromJsonValue<qint32>(source["AirsBeforeEpisodeNumber"]);
|
||||
m_canDelete = Jellyfin::Support::fromJsonValue<bool>(source["CanDelete"]);
|
||||
m_canDownload = Jellyfin::Support::fromJsonValue<bool>(source["CanDownload"]);
|
||||
m_hasSubtitles = Jellyfin::Support::fromJsonValue<bool>(source["HasSubtitles"]);
|
||||
m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["PreferredMetadataLanguage"]);
|
||||
m_preferredMetadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["PreferredMetadataCountryCode"]);
|
||||
m_supportsSync = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
|
||||
m_sortName = Jellyfin::Support::fromJsonValue<QString>(source["SortName"]);
|
||||
m_forcedSortName = Jellyfin::Support::fromJsonValue<QString>(source["ForcedSortName"]);
|
||||
m_video3DFormat = Jellyfin::Support::fromJsonValue<Video3DFormat>(source["Video3DFormat"]);
|
||||
m_premiereDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_externalUrls = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ExternalUrl>>>(source["ExternalUrls"]);
|
||||
m_mediaSources = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<MediaSourceInfo>>>(source["MediaSources"]);
|
||||
m_criticRating = Jellyfin::Support::fromJsonValue<float>(source["CriticRating"]);
|
||||
m_productionLocations = Jellyfin::Support::fromJsonValue<QStringList>(source["ProductionLocations"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_enableMediaSourceDisplay = Jellyfin::Support::fromJsonValue<bool>(source["EnableMediaSourceDisplay"]);
|
||||
m_officialRating = Jellyfin::Support::fromJsonValue<QString>(source["OfficialRating"]);
|
||||
m_customRating = Jellyfin::Support::fromJsonValue<QString>(source["CustomRating"]);
|
||||
m_channelId = Jellyfin::Support::fromJsonValue<QUuid>(source["ChannelId"]);
|
||||
m_channelName = Jellyfin::Support::fromJsonValue<QString>(source["ChannelName"]);
|
||||
m_overview = Jellyfin::Support::fromJsonValue<QString>(source["Overview"]);
|
||||
m_taglines = Jellyfin::Support::fromJsonValue<QStringList>(source["Taglines"]);
|
||||
m_genres = Jellyfin::Support::fromJsonValue<QStringList>(source["Genres"]);
|
||||
m_communityRating = Jellyfin::Support::fromJsonValue<float>(source["CommunityRating"]);
|
||||
m_cumulativeRunTimeTicks = Jellyfin::Support::fromJsonValue<qint64>(source["CumulativeRunTimeTicks"]);
|
||||
m_runTimeTicks = Jellyfin::Support::fromJsonValue<qint64>(source["RunTimeTicks"]);
|
||||
m_playAccess = Jellyfin::Support::fromJsonValue<PlayAccess>(source["PlayAccess"]);
|
||||
m_aspectRatio = Jellyfin::Support::fromJsonValue<QString>(source["AspectRatio"]);
|
||||
m_productionYear = Jellyfin::Support::fromJsonValue<qint32>(source["ProductionYear"]);
|
||||
m_isPlaceHolder = Jellyfin::Support::fromJsonValue<bool>(source["IsPlaceHolder"]);
|
||||
m_number = Jellyfin::Support::fromJsonValue<QString>(source["Number"]);
|
||||
m_channelNumber = Jellyfin::Support::fromJsonValue<QString>(source["ChannelNumber"]);
|
||||
m_indexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_indexNumberEnd = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumberEnd"]);
|
||||
m_parentIndexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_remoteTrailers = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<MediaUrl>>>(source["RemoteTrailers"]);
|
||||
m_providerIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_isHD = Jellyfin::Support::fromJsonValue<bool>(source["IsHD"]);
|
||||
m_isFolder = Jellyfin::Support::fromJsonValue<bool>(source["IsFolder"]);
|
||||
m_parentId = Jellyfin::Support::fromJsonValue<QUuid>(source["ParentId"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<QString>(source["Type"]);
|
||||
m_people = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<BaseItemPerson>>>(source["People"]);
|
||||
m_studios = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["Studios"]);
|
||||
m_genreItems = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["GenreItems"]);
|
||||
m_parentLogoItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentLogoItemId"]);
|
||||
m_parentBackdropItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentBackdropItemId"]);
|
||||
m_parentBackdropImageTags = Jellyfin::Support::fromJsonValue<QStringList>(source["ParentBackdropImageTags"]);
|
||||
m_localTrailerCount = Jellyfin::Support::fromJsonValue<qint32>(source["LocalTrailerCount"]);
|
||||
m_userData = Jellyfin::Support::fromJsonValue<QSharedPointer<UserItemDataDto>>(source["UserData"]);
|
||||
m_recursiveItemCount = Jellyfin::Support::fromJsonValue<qint32>(source["RecursiveItemCount"]);
|
||||
m_childCount = Jellyfin::Support::fromJsonValue<qint32>(source["ChildCount"]);
|
||||
m_seriesName = Jellyfin::Support::fromJsonValue<QString>(source["SeriesName"]);
|
||||
m_seriesId = Jellyfin::Support::fromJsonValue<QUuid>(source["SeriesId"]);
|
||||
m_seasonId = Jellyfin::Support::fromJsonValue<QUuid>(source["SeasonId"]);
|
||||
m_specialFeatureCount = Jellyfin::Support::fromJsonValue<qint32>(source["SpecialFeatureCount"]);
|
||||
m_displayPreferencesId = Jellyfin::Support::fromJsonValue<QString>(source["DisplayPreferencesId"]);
|
||||
m_status = Jellyfin::Support::fromJsonValue<QString>(source["Status"]);
|
||||
m_airTime = Jellyfin::Support::fromJsonValue<QString>(source["AirTime"]);
|
||||
m_airDays = Jellyfin::Support::fromJsonValue<QList<DayOfWeek>>(source["AirDays"]);
|
||||
m_tags = Jellyfin::Support::fromJsonValue<QStringList>(source["Tags"]);
|
||||
m_primaryImageAspectRatio = Jellyfin::Support::fromJsonValue<double>(source["PrimaryImageAspectRatio"]);
|
||||
m_artists = Jellyfin::Support::fromJsonValue<QStringList>(source["Artists"]);
|
||||
m_artistItems = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["ArtistItems"]);
|
||||
m_album = Jellyfin::Support::fromJsonValue<QString>(source["Album"]);
|
||||
m_collectionType = Jellyfin::Support::fromJsonValue<QString>(source["CollectionType"]);
|
||||
m_displayOrder = Jellyfin::Support::fromJsonValue<QString>(source["DisplayOrder"]);
|
||||
m_albumId = Jellyfin::Support::fromJsonValue<QUuid>(source["AlbumId"]);
|
||||
m_albumPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["AlbumPrimaryImageTag"]);
|
||||
m_seriesPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["SeriesPrimaryImageTag"]);
|
||||
m_albumArtist = Jellyfin::Support::fromJsonValue<QString>(source["AlbumArtist"]);
|
||||
m_albumArtists = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameGuidPair>>>(source["AlbumArtists"]);
|
||||
m_seasonName = Jellyfin::Support::fromJsonValue<QString>(source["SeasonName"]);
|
||||
m_mediaStreams = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<MediaStream>>>(source["MediaStreams"]);
|
||||
m_videoType = Jellyfin::Support::fromJsonValue<VideoType>(source["VideoType"]);
|
||||
m_partCount = Jellyfin::Support::fromJsonValue<qint32>(source["PartCount"]);
|
||||
m_mediaSourceCount = Jellyfin::Support::fromJsonValue<qint32>(source["MediaSourceCount"]);
|
||||
m_imageTags = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ImageTags"]);
|
||||
m_backdropImageTags = Jellyfin::Support::fromJsonValue<QStringList>(source["BackdropImageTags"]);
|
||||
m_screenshotImageTags = Jellyfin::Support::fromJsonValue<QStringList>(source["ScreenshotImageTags"]);
|
||||
m_parentLogoImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ParentLogoImageTag"]);
|
||||
m_parentArtItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentArtItemId"]);
|
||||
m_parentArtImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ParentArtImageTag"]);
|
||||
m_seriesThumbImageTag = Jellyfin::Support::fromJsonValue<QString>(source["SeriesThumbImageTag"]);
|
||||
m_imageBlurHashes = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ImageBlurHashes"]);
|
||||
m_seriesStudio = Jellyfin::Support::fromJsonValue<QString>(source["SeriesStudio"]);
|
||||
m_parentThumbItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentThumbItemId"]);
|
||||
m_parentThumbImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ParentThumbImageTag"]);
|
||||
m_parentPrimaryImageItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentPrimaryImageItemId"]);
|
||||
m_parentPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ParentPrimaryImageTag"]);
|
||||
m_chapters = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ChapterInfo>>>(source["Chapters"]);
|
||||
m_locationType = Jellyfin::Support::fromJsonValue<LocationType>(source["LocationType"]);
|
||||
m_isoType = Jellyfin::Support::fromJsonValue<IsoType>(source["IsoType"]);
|
||||
m_mediaType = Jellyfin::Support::fromJsonValue<QString>(source["MediaType"]);
|
||||
m_endDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["EndDate"]);
|
||||
m_lockedFields = Jellyfin::Support::fromJsonValue<QList<MetadataField>>(source["LockedFields"]);
|
||||
m_trailerCount = Jellyfin::Support::fromJsonValue<qint32>(source["TrailerCount"]);
|
||||
m_movieCount = Jellyfin::Support::fromJsonValue<qint32>(source["MovieCount"]);
|
||||
m_seriesCount = Jellyfin::Support::fromJsonValue<qint32>(source["SeriesCount"]);
|
||||
m_programCount = Jellyfin::Support::fromJsonValue<qint32>(source["ProgramCount"]);
|
||||
m_episodeCount = Jellyfin::Support::fromJsonValue<qint32>(source["EpisodeCount"]);
|
||||
m_songCount = Jellyfin::Support::fromJsonValue<qint32>(source["SongCount"]);
|
||||
m_albumCount = Jellyfin::Support::fromJsonValue<qint32>(source["AlbumCount"]);
|
||||
m_artistCount = Jellyfin::Support::fromJsonValue<qint32>(source["ArtistCount"]);
|
||||
m_musicVideoCount = Jellyfin::Support::fromJsonValue<qint32>(source["MusicVideoCount"]);
|
||||
m_lockData = Jellyfin::Support::fromJsonValue<bool>(source["LockData"]);
|
||||
m_width = Jellyfin::Support::fromJsonValue<qint32>(source["Width"]);
|
||||
m_height = Jellyfin::Support::fromJsonValue<qint32>(source["Height"]);
|
||||
m_cameraMake = Jellyfin::Support::fromJsonValue<QString>(source["CameraMake"]);
|
||||
m_cameraModel = Jellyfin::Support::fromJsonValue<QString>(source["CameraModel"]);
|
||||
m_software = Jellyfin::Support::fromJsonValue<QString>(source["Software"]);
|
||||
m_exposureTime = Jellyfin::Support::fromJsonValue<double>(source["ExposureTime"]);
|
||||
m_focalLength = Jellyfin::Support::fromJsonValue<double>(source["FocalLength"]);
|
||||
m_imageOrientation = Jellyfin::Support::fromJsonValue<ImageOrientation>(source["ImageOrientation"]);
|
||||
m_aperture = Jellyfin::Support::fromJsonValue<double>(source["Aperture"]);
|
||||
m_shutterSpeed = Jellyfin::Support::fromJsonValue<double>(source["ShutterSpeed"]);
|
||||
m_latitude = Jellyfin::Support::fromJsonValue<double>(source["Latitude"]);
|
||||
m_longitude = Jellyfin::Support::fromJsonValue<double>(source["Longitude"]);
|
||||
m_altitude = Jellyfin::Support::fromJsonValue<double>(source["Altitude"]);
|
||||
m_isoSpeedRating = Jellyfin::Support::fromJsonValue<qint32>(source["IsoSpeedRating"]);
|
||||
m_seriesTimerId = Jellyfin::Support::fromJsonValue<QString>(source["SeriesTimerId"]);
|
||||
m_programId = Jellyfin::Support::fromJsonValue<QString>(source["ProgramId"]);
|
||||
m_channelPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ChannelPrimaryImageTag"]);
|
||||
m_startDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["StartDate"]);
|
||||
m_completionPercentage = Jellyfin::Support::fromJsonValue<double>(source["CompletionPercentage"]);
|
||||
m_isRepeat = Jellyfin::Support::fromJsonValue<bool>(source["IsRepeat"]);
|
||||
m_episodeTitle = Jellyfin::Support::fromJsonValue<QString>(source["EpisodeTitle"]);
|
||||
m_channelType = Jellyfin::Support::fromJsonValue<ChannelType>(source["ChannelType"]);
|
||||
m_audio = Jellyfin::Support::fromJsonValue<ProgramAudio>(source["Audio"]);
|
||||
m_isMovie = Jellyfin::Support::fromJsonValue<bool>(source["IsMovie"]);
|
||||
m_isSports = Jellyfin::Support::fromJsonValue<bool>(source["IsSports"]);
|
||||
m_isSeries = Jellyfin::Support::fromJsonValue<bool>(source["IsSeries"]);
|
||||
m_isLive = Jellyfin::Support::fromJsonValue<bool>(source["IsLive"]);
|
||||
m_isNews = Jellyfin::Support::fromJsonValue<bool>(source["IsNews"]);
|
||||
m_isKids = Jellyfin::Support::fromJsonValue<bool>(source["IsKids"]);
|
||||
m_isPremiere = Jellyfin::Support::fromJsonValue<bool>(source["IsPremiere"]);
|
||||
m_timerId = Jellyfin::Support::fromJsonValue<QString>(source["TimerId"]);
|
||||
m_currentProgram = Jellyfin::Support::fromJsonValue<QSharedPointer<BaseItemDto>>(source["CurrentProgram"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BaseItemDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["OriginalTitle"] = toJsonValue<QString>(m_originalTitle);
|
||||
result["ServerId"] = toJsonValue<QString>(m_serverId);
|
||||
result["Id"] = toJsonValue<QUuid>(m_jellyfinId);
|
||||
result["Etag"] = toJsonValue<QString>(m_etag);
|
||||
result["SourceType"] = toJsonValue<QString>(m_sourceType);
|
||||
result["PlaylistItemId"] = toJsonValue<QString>(m_playlistItemId);
|
||||
result["DateCreated"] = toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateLastMediaAdded"] = toJsonValue<QDateTime>(m_dateLastMediaAdded);
|
||||
result["ExtraType"] = toJsonValue<QString>(m_extraType);
|
||||
result["AirsBeforeSeasonNumber"] = toJsonValue<qint32>(m_airsBeforeSeasonNumber);
|
||||
result["AirsAfterSeasonNumber"] = toJsonValue<qint32>(m_airsAfterSeasonNumber);
|
||||
result["AirsBeforeEpisodeNumber"] = toJsonValue<qint32>(m_airsBeforeEpisodeNumber);
|
||||
result["CanDelete"] = toJsonValue<bool>(m_canDelete);
|
||||
result["CanDownload"] = toJsonValue<bool>(m_canDownload);
|
||||
result["HasSubtitles"] = toJsonValue<bool>(m_hasSubtitles);
|
||||
result["PreferredMetadataLanguage"] = toJsonValue<QString>(m_preferredMetadataLanguage);
|
||||
result["PreferredMetadataCountryCode"] = toJsonValue<QString>(m_preferredMetadataCountryCode);
|
||||
result["SupportsSync"] = toJsonValue<bool>(m_supportsSync);
|
||||
result["Container"] = toJsonValue<QString>(m_container);
|
||||
result["SortName"] = toJsonValue<QString>(m_sortName);
|
||||
result["ForcedSortName"] = toJsonValue<QString>(m_forcedSortName);
|
||||
result["Video3DFormat"] = toJsonValue<Video3DFormat>(m_video3DFormat);
|
||||
result["PremiereDate"] = toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["ExternalUrls"] = toJsonValue<QList<QSharedPointer<ExternalUrl>>>(m_externalUrls);
|
||||
result["MediaSources"] = toJsonValue<QList<QSharedPointer<MediaSourceInfo>>>(m_mediaSources);
|
||||
result["CriticRating"] = toJsonValue<float>(m_criticRating);
|
||||
result["ProductionLocations"] = toJsonValue<QStringList>(m_productionLocations);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["EnableMediaSourceDisplay"] = toJsonValue<bool>(m_enableMediaSourceDisplay);
|
||||
result["OfficialRating"] = toJsonValue<QString>(m_officialRating);
|
||||
result["CustomRating"] = toJsonValue<QString>(m_customRating);
|
||||
result["ChannelId"] = toJsonValue<QUuid>(m_channelId);
|
||||
result["ChannelName"] = toJsonValue<QString>(m_channelName);
|
||||
result["Overview"] = toJsonValue<QString>(m_overview);
|
||||
result["Taglines"] = toJsonValue<QStringList>(m_taglines);
|
||||
result["Genres"] = toJsonValue<QStringList>(m_genres);
|
||||
result["CommunityRating"] = toJsonValue<float>(m_communityRating);
|
||||
result["CumulativeRunTimeTicks"] = toJsonValue<qint64>(m_cumulativeRunTimeTicks);
|
||||
result["RunTimeTicks"] = toJsonValue<qint64>(m_runTimeTicks);
|
||||
result["PlayAccess"] = toJsonValue<PlayAccess>(m_playAccess);
|
||||
result["AspectRatio"] = toJsonValue<QString>(m_aspectRatio);
|
||||
result["ProductionYear"] = toJsonValue<qint32>(m_productionYear);
|
||||
result["IsPlaceHolder"] = toJsonValue<bool>(m_isPlaceHolder);
|
||||
result["Number"] = toJsonValue<QString>(m_number);
|
||||
result["ChannelNumber"] = toJsonValue<QString>(m_channelNumber);
|
||||
result["IndexNumber"] = toJsonValue<qint32>(m_indexNumber);
|
||||
result["IndexNumberEnd"] = toJsonValue<qint32>(m_indexNumberEnd);
|
||||
result["ParentIndexNumber"] = toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["RemoteTrailers"] = toJsonValue<QList<QSharedPointer<MediaUrl>>>(m_remoteTrailers);
|
||||
result["ProviderIds"] = toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["IsHD"] = toJsonValue<bool>(m_isHD);
|
||||
result["IsFolder"] = toJsonValue<bool>(m_isFolder);
|
||||
result["ParentId"] = toJsonValue<QUuid>(m_parentId);
|
||||
result["Type"] = toJsonValue<QString>(m_type);
|
||||
result["People"] = toJsonValue<QList<QSharedPointer<BaseItemPerson>>>(m_people);
|
||||
result["Studios"] = toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_studios);
|
||||
result["GenreItems"] = toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_genreItems);
|
||||
result["ParentLogoItemId"] = toJsonValue<QString>(m_parentLogoItemId);
|
||||
result["ParentBackdropItemId"] = toJsonValue<QString>(m_parentBackdropItemId);
|
||||
result["ParentBackdropImageTags"] = toJsonValue<QStringList>(m_parentBackdropImageTags);
|
||||
result["LocalTrailerCount"] = toJsonValue<qint32>(m_localTrailerCount);
|
||||
result["UserData"] = toJsonValue<QSharedPointer<UserItemDataDto>>(m_userData);
|
||||
result["RecursiveItemCount"] = toJsonValue<qint32>(m_recursiveItemCount);
|
||||
result["ChildCount"] = toJsonValue<qint32>(m_childCount);
|
||||
result["SeriesName"] = toJsonValue<QString>(m_seriesName);
|
||||
result["SeriesId"] = toJsonValue<QUuid>(m_seriesId);
|
||||
result["SeasonId"] = toJsonValue<QUuid>(m_seasonId);
|
||||
result["SpecialFeatureCount"] = toJsonValue<qint32>(m_specialFeatureCount);
|
||||
result["DisplayPreferencesId"] = toJsonValue<QString>(m_displayPreferencesId);
|
||||
result["Status"] = toJsonValue<QString>(m_status);
|
||||
result["AirTime"] = toJsonValue<QString>(m_airTime);
|
||||
result["AirDays"] = toJsonValue<QList<DayOfWeek>>(m_airDays);
|
||||
result["Tags"] = toJsonValue<QStringList>(m_tags);
|
||||
result["PrimaryImageAspectRatio"] = toJsonValue<double>(m_primaryImageAspectRatio);
|
||||
result["Artists"] = toJsonValue<QStringList>(m_artists);
|
||||
result["ArtistItems"] = toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_artistItems);
|
||||
result["Album"] = toJsonValue<QString>(m_album);
|
||||
result["CollectionType"] = toJsonValue<QString>(m_collectionType);
|
||||
result["DisplayOrder"] = toJsonValue<QString>(m_displayOrder);
|
||||
result["AlbumId"] = toJsonValue<QUuid>(m_albumId);
|
||||
result["AlbumPrimaryImageTag"] = toJsonValue<QString>(m_albumPrimaryImageTag);
|
||||
result["SeriesPrimaryImageTag"] = toJsonValue<QString>(m_seriesPrimaryImageTag);
|
||||
result["AlbumArtist"] = toJsonValue<QString>(m_albumArtist);
|
||||
result["AlbumArtists"] = toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_albumArtists);
|
||||
result["SeasonName"] = toJsonValue<QString>(m_seasonName);
|
||||
result["MediaStreams"] = toJsonValue<QList<QSharedPointer<MediaStream>>>(m_mediaStreams);
|
||||
result["VideoType"] = toJsonValue<VideoType>(m_videoType);
|
||||
result["PartCount"] = toJsonValue<qint32>(m_partCount);
|
||||
result["MediaSourceCount"] = toJsonValue<qint32>(m_mediaSourceCount);
|
||||
result["ImageTags"] = toJsonValue<QJsonObject>(m_imageTags);
|
||||
result["BackdropImageTags"] = toJsonValue<QStringList>(m_backdropImageTags);
|
||||
result["ScreenshotImageTags"] = toJsonValue<QStringList>(m_screenshotImageTags);
|
||||
result["ParentLogoImageTag"] = toJsonValue<QString>(m_parentLogoImageTag);
|
||||
result["ParentArtItemId"] = toJsonValue<QString>(m_parentArtItemId);
|
||||
result["ParentArtImageTag"] = toJsonValue<QString>(m_parentArtImageTag);
|
||||
result["SeriesThumbImageTag"] = toJsonValue<QString>(m_seriesThumbImageTag);
|
||||
result["ImageBlurHashes"] = toJsonValue<QJsonObject>(m_imageBlurHashes);
|
||||
result["SeriesStudio"] = toJsonValue<QString>(m_seriesStudio);
|
||||
result["ParentThumbItemId"] = toJsonValue<QString>(m_parentThumbItemId);
|
||||
result["ParentThumbImageTag"] = toJsonValue<QString>(m_parentThumbImageTag);
|
||||
result["ParentPrimaryImageItemId"] = toJsonValue<QString>(m_parentPrimaryImageItemId);
|
||||
result["ParentPrimaryImageTag"] = toJsonValue<QString>(m_parentPrimaryImageTag);
|
||||
result["Chapters"] = toJsonValue<QList<QSharedPointer<ChapterInfo>>>(m_chapters);
|
||||
result["LocationType"] = toJsonValue<LocationType>(m_locationType);
|
||||
result["IsoType"] = toJsonValue<IsoType>(m_isoType);
|
||||
result["MediaType"] = toJsonValue<QString>(m_mediaType);
|
||||
result["EndDate"] = toJsonValue<QDateTime>(m_endDate);
|
||||
result["LockedFields"] = toJsonValue<QList<MetadataField>>(m_lockedFields);
|
||||
result["TrailerCount"] = toJsonValue<qint32>(m_trailerCount);
|
||||
result["MovieCount"] = toJsonValue<qint32>(m_movieCount);
|
||||
result["SeriesCount"] = toJsonValue<qint32>(m_seriesCount);
|
||||
result["ProgramCount"] = toJsonValue<qint32>(m_programCount);
|
||||
result["EpisodeCount"] = toJsonValue<qint32>(m_episodeCount);
|
||||
result["SongCount"] = toJsonValue<qint32>(m_songCount);
|
||||
result["AlbumCount"] = toJsonValue<qint32>(m_albumCount);
|
||||
result["ArtistCount"] = toJsonValue<qint32>(m_artistCount);
|
||||
result["MusicVideoCount"] = toJsonValue<qint32>(m_musicVideoCount);
|
||||
result["LockData"] = toJsonValue<bool>(m_lockData);
|
||||
result["Width"] = toJsonValue<qint32>(m_width);
|
||||
result["Height"] = toJsonValue<qint32>(m_height);
|
||||
result["CameraMake"] = toJsonValue<QString>(m_cameraMake);
|
||||
result["CameraModel"] = toJsonValue<QString>(m_cameraModel);
|
||||
result["Software"] = toJsonValue<QString>(m_software);
|
||||
result["ExposureTime"] = toJsonValue<double>(m_exposureTime);
|
||||
result["FocalLength"] = toJsonValue<double>(m_focalLength);
|
||||
result["ImageOrientation"] = toJsonValue<ImageOrientation>(m_imageOrientation);
|
||||
result["Aperture"] = toJsonValue<double>(m_aperture);
|
||||
result["ShutterSpeed"] = toJsonValue<double>(m_shutterSpeed);
|
||||
result["Latitude"] = toJsonValue<double>(m_latitude);
|
||||
result["Longitude"] = toJsonValue<double>(m_longitude);
|
||||
result["Altitude"] = toJsonValue<double>(m_altitude);
|
||||
result["IsoSpeedRating"] = toJsonValue<qint32>(m_isoSpeedRating);
|
||||
result["SeriesTimerId"] = toJsonValue<QString>(m_seriesTimerId);
|
||||
result["ProgramId"] = toJsonValue<QString>(m_programId);
|
||||
result["ChannelPrimaryImageTag"] = toJsonValue<QString>(m_channelPrimaryImageTag);
|
||||
result["StartDate"] = toJsonValue<QDateTime>(m_startDate);
|
||||
result["CompletionPercentage"] = toJsonValue<double>(m_completionPercentage);
|
||||
result["IsRepeat"] = toJsonValue<bool>(m_isRepeat);
|
||||
result["EpisodeTitle"] = toJsonValue<QString>(m_episodeTitle);
|
||||
result["ChannelType"] = toJsonValue<ChannelType>(m_channelType);
|
||||
result["Audio"] = toJsonValue<ProgramAudio>(m_audio);
|
||||
result["IsMovie"] = toJsonValue<bool>(m_isMovie);
|
||||
result["IsSports"] = toJsonValue<bool>(m_isSports);
|
||||
result["IsSeries"] = toJsonValue<bool>(m_isSeries);
|
||||
result["IsLive"] = toJsonValue<bool>(m_isLive);
|
||||
result["IsNews"] = toJsonValue<bool>(m_isNews);
|
||||
result["IsKids"] = toJsonValue<bool>(m_isKids);
|
||||
result["IsPremiere"] = toJsonValue<bool>(m_isPremiere);
|
||||
result["TimerId"] = toJsonValue<QString>(m_timerId);
|
||||
result["CurrentProgram"] = toJsonValue<QSharedPointer<BaseItemDto>>(m_currentProgram);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
|
||||
result["ServerId"] = Jellyfin::Support::toJsonValue<QString>(m_serverId);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QUuid>(m_jellyfinId);
|
||||
result["Etag"] = Jellyfin::Support::toJsonValue<QString>(m_etag);
|
||||
result["SourceType"] = Jellyfin::Support::toJsonValue<QString>(m_sourceType);
|
||||
result["PlaylistItemId"] = Jellyfin::Support::toJsonValue<QString>(m_playlistItemId);
|
||||
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateLastMediaAdded"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastMediaAdded);
|
||||
result["ExtraType"] = Jellyfin::Support::toJsonValue<QString>(m_extraType);
|
||||
result["AirsBeforeSeasonNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_airsBeforeSeasonNumber);
|
||||
result["AirsAfterSeasonNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_airsAfterSeasonNumber);
|
||||
result["AirsBeforeEpisodeNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_airsBeforeEpisodeNumber);
|
||||
result["CanDelete"] = Jellyfin::Support::toJsonValue<bool>(m_canDelete);
|
||||
result["CanDownload"] = Jellyfin::Support::toJsonValue<bool>(m_canDownload);
|
||||
result["HasSubtitles"] = Jellyfin::Support::toJsonValue<bool>(m_hasSubtitles);
|
||||
result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataLanguage);
|
||||
result["PreferredMetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataCountryCode);
|
||||
result["SupportsSync"] = Jellyfin::Support::toJsonValue<bool>(m_supportsSync);
|
||||
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
|
||||
result["SortName"] = Jellyfin::Support::toJsonValue<QString>(m_sortName);
|
||||
result["ForcedSortName"] = Jellyfin::Support::toJsonValue<QString>(m_forcedSortName);
|
||||
result["Video3DFormat"] = Jellyfin::Support::toJsonValue<Video3DFormat>(m_video3DFormat);
|
||||
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["ExternalUrls"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ExternalUrl>>>(m_externalUrls);
|
||||
result["MediaSources"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<MediaSourceInfo>>>(m_mediaSources);
|
||||
result["CriticRating"] = Jellyfin::Support::toJsonValue<float>(m_criticRating);
|
||||
result["ProductionLocations"] = Jellyfin::Support::toJsonValue<QStringList>(m_productionLocations);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["EnableMediaSourceDisplay"] = Jellyfin::Support::toJsonValue<bool>(m_enableMediaSourceDisplay);
|
||||
result["OfficialRating"] = Jellyfin::Support::toJsonValue<QString>(m_officialRating);
|
||||
result["CustomRating"] = Jellyfin::Support::toJsonValue<QString>(m_customRating);
|
||||
result["ChannelId"] = Jellyfin::Support::toJsonValue<QUuid>(m_channelId);
|
||||
result["ChannelName"] = Jellyfin::Support::toJsonValue<QString>(m_channelName);
|
||||
result["Overview"] = Jellyfin::Support::toJsonValue<QString>(m_overview);
|
||||
result["Taglines"] = Jellyfin::Support::toJsonValue<QStringList>(m_taglines);
|
||||
result["Genres"] = Jellyfin::Support::toJsonValue<QStringList>(m_genres);
|
||||
result["CommunityRating"] = Jellyfin::Support::toJsonValue<float>(m_communityRating);
|
||||
result["CumulativeRunTimeTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_cumulativeRunTimeTicks);
|
||||
result["RunTimeTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_runTimeTicks);
|
||||
result["PlayAccess"] = Jellyfin::Support::toJsonValue<PlayAccess>(m_playAccess);
|
||||
result["AspectRatio"] = Jellyfin::Support::toJsonValue<QString>(m_aspectRatio);
|
||||
result["ProductionYear"] = Jellyfin::Support::toJsonValue<qint32>(m_productionYear);
|
||||
result["IsPlaceHolder"] = Jellyfin::Support::toJsonValue<bool>(m_isPlaceHolder);
|
||||
result["Number"] = Jellyfin::Support::toJsonValue<QString>(m_number);
|
||||
result["ChannelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_channelNumber);
|
||||
result["IndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumber);
|
||||
result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumberEnd);
|
||||
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<MediaUrl>>>(m_remoteTrailers);
|
||||
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["IsHD"] = Jellyfin::Support::toJsonValue<bool>(m_isHD);
|
||||
result["IsFolder"] = Jellyfin::Support::toJsonValue<bool>(m_isFolder);
|
||||
result["ParentId"] = Jellyfin::Support::toJsonValue<QUuid>(m_parentId);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
|
||||
result["People"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<BaseItemPerson>>>(m_people);
|
||||
result["Studios"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_studios);
|
||||
result["GenreItems"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_genreItems);
|
||||
result["ParentLogoItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentLogoItemId);
|
||||
result["ParentBackdropItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentBackdropItemId);
|
||||
result["ParentBackdropImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_parentBackdropImageTags);
|
||||
result["LocalTrailerCount"] = Jellyfin::Support::toJsonValue<qint32>(m_localTrailerCount);
|
||||
result["UserData"] = Jellyfin::Support::toJsonValue<QSharedPointer<UserItemDataDto>>(m_userData);
|
||||
result["RecursiveItemCount"] = Jellyfin::Support::toJsonValue<qint32>(m_recursiveItemCount);
|
||||
result["ChildCount"] = Jellyfin::Support::toJsonValue<qint32>(m_childCount);
|
||||
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
|
||||
result["SeriesId"] = Jellyfin::Support::toJsonValue<QUuid>(m_seriesId);
|
||||
result["SeasonId"] = Jellyfin::Support::toJsonValue<QUuid>(m_seasonId);
|
||||
result["SpecialFeatureCount"] = Jellyfin::Support::toJsonValue<qint32>(m_specialFeatureCount);
|
||||
result["DisplayPreferencesId"] = Jellyfin::Support::toJsonValue<QString>(m_displayPreferencesId);
|
||||
result["Status"] = Jellyfin::Support::toJsonValue<QString>(m_status);
|
||||
result["AirTime"] = Jellyfin::Support::toJsonValue<QString>(m_airTime);
|
||||
result["AirDays"] = Jellyfin::Support::toJsonValue<QList<DayOfWeek>>(m_airDays);
|
||||
result["Tags"] = Jellyfin::Support::toJsonValue<QStringList>(m_tags);
|
||||
result["PrimaryImageAspectRatio"] = Jellyfin::Support::toJsonValue<double>(m_primaryImageAspectRatio);
|
||||
result["Artists"] = Jellyfin::Support::toJsonValue<QStringList>(m_artists);
|
||||
result["ArtistItems"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_artistItems);
|
||||
result["Album"] = Jellyfin::Support::toJsonValue<QString>(m_album);
|
||||
result["CollectionType"] = Jellyfin::Support::toJsonValue<QString>(m_collectionType);
|
||||
result["DisplayOrder"] = Jellyfin::Support::toJsonValue<QString>(m_displayOrder);
|
||||
result["AlbumId"] = Jellyfin::Support::toJsonValue<QUuid>(m_albumId);
|
||||
result["AlbumPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_albumPrimaryImageTag);
|
||||
result["SeriesPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_seriesPrimaryImageTag);
|
||||
result["AlbumArtist"] = Jellyfin::Support::toJsonValue<QString>(m_albumArtist);
|
||||
result["AlbumArtists"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameGuidPair>>>(m_albumArtists);
|
||||
result["SeasonName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonName);
|
||||
result["MediaStreams"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<MediaStream>>>(m_mediaStreams);
|
||||
result["VideoType"] = Jellyfin::Support::toJsonValue<VideoType>(m_videoType);
|
||||
result["PartCount"] = Jellyfin::Support::toJsonValue<qint32>(m_partCount);
|
||||
result["MediaSourceCount"] = Jellyfin::Support::toJsonValue<qint32>(m_mediaSourceCount);
|
||||
result["ImageTags"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageTags);
|
||||
result["BackdropImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_backdropImageTags);
|
||||
result["ScreenshotImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_screenshotImageTags);
|
||||
result["ParentLogoImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentLogoImageTag);
|
||||
result["ParentArtItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentArtItemId);
|
||||
result["ParentArtImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentArtImageTag);
|
||||
result["SeriesThumbImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_seriesThumbImageTag);
|
||||
result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageBlurHashes);
|
||||
result["SeriesStudio"] = Jellyfin::Support::toJsonValue<QString>(m_seriesStudio);
|
||||
result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentThumbItemId);
|
||||
result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentThumbImageTag);
|
||||
result["ParentPrimaryImageItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentPrimaryImageItemId);
|
||||
result["ParentPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentPrimaryImageTag);
|
||||
result["Chapters"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ChapterInfo>>>(m_chapters);
|
||||
result["LocationType"] = Jellyfin::Support::toJsonValue<LocationType>(m_locationType);
|
||||
result["IsoType"] = Jellyfin::Support::toJsonValue<IsoType>(m_isoType);
|
||||
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
|
||||
result["EndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_endDate);
|
||||
result["LockedFields"] = Jellyfin::Support::toJsonValue<QList<MetadataField>>(m_lockedFields);
|
||||
result["TrailerCount"] = Jellyfin::Support::toJsonValue<qint32>(m_trailerCount);
|
||||
result["MovieCount"] = Jellyfin::Support::toJsonValue<qint32>(m_movieCount);
|
||||
result["SeriesCount"] = Jellyfin::Support::toJsonValue<qint32>(m_seriesCount);
|
||||
result["ProgramCount"] = Jellyfin::Support::toJsonValue<qint32>(m_programCount);
|
||||
result["EpisodeCount"] = Jellyfin::Support::toJsonValue<qint32>(m_episodeCount);
|
||||
result["SongCount"] = Jellyfin::Support::toJsonValue<qint32>(m_songCount);
|
||||
result["AlbumCount"] = Jellyfin::Support::toJsonValue<qint32>(m_albumCount);
|
||||
result["ArtistCount"] = Jellyfin::Support::toJsonValue<qint32>(m_artistCount);
|
||||
result["MusicVideoCount"] = Jellyfin::Support::toJsonValue<qint32>(m_musicVideoCount);
|
||||
result["LockData"] = Jellyfin::Support::toJsonValue<bool>(m_lockData);
|
||||
result["Width"] = Jellyfin::Support::toJsonValue<qint32>(m_width);
|
||||
result["Height"] = Jellyfin::Support::toJsonValue<qint32>(m_height);
|
||||
result["CameraMake"] = Jellyfin::Support::toJsonValue<QString>(m_cameraMake);
|
||||
result["CameraModel"] = Jellyfin::Support::toJsonValue<QString>(m_cameraModel);
|
||||
result["Software"] = Jellyfin::Support::toJsonValue<QString>(m_software);
|
||||
result["ExposureTime"] = Jellyfin::Support::toJsonValue<double>(m_exposureTime);
|
||||
result["FocalLength"] = Jellyfin::Support::toJsonValue<double>(m_focalLength);
|
||||
result["ImageOrientation"] = Jellyfin::Support::toJsonValue<ImageOrientation>(m_imageOrientation);
|
||||
result["Aperture"] = Jellyfin::Support::toJsonValue<double>(m_aperture);
|
||||
result["ShutterSpeed"] = Jellyfin::Support::toJsonValue<double>(m_shutterSpeed);
|
||||
result["Latitude"] = Jellyfin::Support::toJsonValue<double>(m_latitude);
|
||||
result["Longitude"] = Jellyfin::Support::toJsonValue<double>(m_longitude);
|
||||
result["Altitude"] = Jellyfin::Support::toJsonValue<double>(m_altitude);
|
||||
result["IsoSpeedRating"] = Jellyfin::Support::toJsonValue<qint32>(m_isoSpeedRating);
|
||||
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
|
||||
result["ProgramId"] = Jellyfin::Support::toJsonValue<QString>(m_programId);
|
||||
result["ChannelPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_channelPrimaryImageTag);
|
||||
result["StartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_startDate);
|
||||
result["CompletionPercentage"] = Jellyfin::Support::toJsonValue<double>(m_completionPercentage);
|
||||
result["IsRepeat"] = Jellyfin::Support::toJsonValue<bool>(m_isRepeat);
|
||||
result["EpisodeTitle"] = Jellyfin::Support::toJsonValue<QString>(m_episodeTitle);
|
||||
result["ChannelType"] = Jellyfin::Support::toJsonValue<ChannelType>(m_channelType);
|
||||
result["Audio"] = Jellyfin::Support::toJsonValue<ProgramAudio>(m_audio);
|
||||
result["IsMovie"] = Jellyfin::Support::toJsonValue<bool>(m_isMovie);
|
||||
result["IsSports"] = Jellyfin::Support::toJsonValue<bool>(m_isSports);
|
||||
result["IsSeries"] = Jellyfin::Support::toJsonValue<bool>(m_isSeries);
|
||||
result["IsLive"] = Jellyfin::Support::toJsonValue<bool>(m_isLive);
|
||||
result["IsNews"] = Jellyfin::Support::toJsonValue<bool>(m_isNews);
|
||||
result["IsKids"] = Jellyfin::Support::toJsonValue<bool>(m_isKids);
|
||||
result["IsPremiere"] = Jellyfin::Support::toJsonValue<bool>(m_isPremiere);
|
||||
result["TimerId"] = Jellyfin::Support::toJsonValue<QString>(m_timerId);
|
||||
result["CurrentProgram"] = Jellyfin::Support::toJsonValue<QSharedPointer<BaseItemDto>>(m_currentProgram);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1108,6 +1109,17 @@ void BaseItemDto::setCurrentProgram(QSharedPointer<BaseItemDto> newCurrentProgra
|
|||
m_currentProgram = newCurrentProgram;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BaseItemDto = Jellyfin::DTO::BaseItemDto;
|
||||
|
||||
template <>
|
||||
BaseItemDto fromJsonValue<BaseItemDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BaseItemDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BaseItemDtoQueryResult::BaseItemDtoQueryResult(QObject *parent) {}
|
||||
BaseItemDtoQueryResult::BaseItemDtoQueryResult() {}
|
||||
|
||||
BaseItemDtoQueryResult BaseItemDtoQueryResult::fromJson(QJsonObject source) {BaseItemDtoQueryResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
BaseItemDtoQueryResult BaseItemDtoQueryResult::fromJson(QJsonObject source) {
|
||||
BaseItemDtoQueryResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BaseItemDtoQueryResult::setFromJson(QJsonObject source) {
|
||||
m_items = fromJsonValue<QList<QSharedPointer<BaseItemDto>>>(source["Items"]);
|
||||
m_totalRecordCount = fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_items = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<BaseItemDto>>>(source["Items"]);
|
||||
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BaseItemDtoQueryResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Items"] = toJsonValue<QList<QSharedPointer<BaseItemDto>>>(m_items);
|
||||
result["TotalRecordCount"] = toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = toJsonValue<qint32>(m_startIndex);
|
||||
result["Items"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<BaseItemDto>>>(m_items);
|
||||
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void BaseItemDtoQueryResult::setStartIndex(qint32 newStartIndex) {
|
|||
m_startIndex = newStartIndex;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BaseItemDtoQueryResult = Jellyfin::DTO::BaseItemDtoQueryResult;
|
||||
|
||||
template <>
|
||||
BaseItemDtoQueryResult fromJsonValue<BaseItemDtoQueryResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BaseItemDtoQueryResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,32 +32,33 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BaseItemPerson::BaseItemPerson(QObject *parent) {}
|
||||
BaseItemPerson::BaseItemPerson() {}
|
||||
|
||||
BaseItemPerson BaseItemPerson::fromJson(QJsonObject source) {BaseItemPerson instance;
|
||||
instance->setFromJson(source, false);
|
||||
BaseItemPerson BaseItemPerson::fromJson(QJsonObject source) {
|
||||
BaseItemPerson instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BaseItemPerson::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_role = fromJsonValue<QString>(source["Role"]);
|
||||
m_type = fromJsonValue<QString>(source["Type"]);
|
||||
m_primaryImageTag = fromJsonValue<QString>(source["PrimaryImageTag"]);
|
||||
m_imageBlurHashes = fromJsonValue<QJsonObject>(source["ImageBlurHashes"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_role = Jellyfin::Support::fromJsonValue<QString>(source["Role"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<QString>(source["Type"]);
|
||||
m_primaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["PrimaryImageTag"]);
|
||||
m_imageBlurHashes = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ImageBlurHashes"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BaseItemPerson::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["Role"] = toJsonValue<QString>(m_role);
|
||||
result["Type"] = toJsonValue<QString>(m_type);
|
||||
result["PrimaryImageTag"] = toJsonValue<QString>(m_primaryImageTag);
|
||||
result["ImageBlurHashes"] = toJsonValue<QJsonObject>(m_imageBlurHashes);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["Role"] = Jellyfin::Support::toJsonValue<QString>(m_role);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
|
||||
result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_primaryImageTag);
|
||||
result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageBlurHashes);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -93,6 +94,17 @@ void BaseItemPerson::setImageBlurHashes(QJsonObject newImageBlurHashes) {
|
|||
m_imageBlurHashes = newImageBlurHashes;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BaseItemPerson = Jellyfin::DTO::BaseItemPerson;
|
||||
|
||||
template <>
|
||||
BaseItemPerson fromJsonValue<BaseItemPerson>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BaseItemPerson::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,42 +32,43 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BookInfo::BookInfo(QObject *parent) {}
|
||||
BookInfo::BookInfo() {}
|
||||
|
||||
BookInfo BookInfo::fromJson(QJsonObject source) {BookInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
BookInfo BookInfo::fromJson(QJsonObject source) {
|
||||
BookInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BookInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_seriesName = fromJsonValue<QString>(source["SeriesName"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = Jellyfin::Support::fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = Jellyfin::Support::fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_seriesName = Jellyfin::Support::fromJsonValue<QString>(source["SeriesName"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BookInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = toJsonValue<bool>(m_isAutomated);
|
||||
result["SeriesName"] = toJsonValue<QString>(m_seriesName);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = Jellyfin::Support::toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
|
||||
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -128,6 +129,17 @@ void BookInfo::setSeriesName(QString newSeriesName) {
|
|||
m_seriesName = newSeriesName;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BookInfo = Jellyfin::DTO::BookInfo;
|
||||
|
||||
template <>
|
||||
BookInfo fromJsonValue<BookInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BookInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BookInfoRemoteSearchQuery::BookInfoRemoteSearchQuery(QObject *parent) {}
|
||||
BookInfoRemoteSearchQuery::BookInfoRemoteSearchQuery() {}
|
||||
|
||||
BookInfoRemoteSearchQuery BookInfoRemoteSearchQuery::fromJson(QJsonObject source) {BookInfoRemoteSearchQuery instance;
|
||||
instance->setFromJson(source, false);
|
||||
BookInfoRemoteSearchQuery BookInfoRemoteSearchQuery::fromJson(QJsonObject source) {
|
||||
BookInfoRemoteSearchQuery instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BookInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
|
||||
m_searchInfo = fromJsonValue<QSharedPointer<BookInfo>>(source["SearchInfo"]);
|
||||
m_itemId = fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
m_searchInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<BookInfo>>(source["SearchInfo"]);
|
||||
m_itemId = Jellyfin::Support::fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = Jellyfin::Support::fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = Jellyfin::Support::fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BookInfoRemoteSearchQuery::toJson() {
|
||||
QJsonObject result;
|
||||
result["SearchInfo"] = toJsonValue<QSharedPointer<BookInfo>>(m_searchInfo);
|
||||
result["ItemId"] = toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = toJsonValue<bool>(m_includeDisabledProviders);
|
||||
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<BookInfo>>(m_searchInfo);
|
||||
result["ItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void BookInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDisab
|
|||
m_includeDisabledProviders = newIncludeDisabledProviders;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BookInfoRemoteSearchQuery = Jellyfin::DTO::BookInfoRemoteSearchQuery;
|
||||
|
||||
template <>
|
||||
BookInfoRemoteSearchQuery fromJsonValue<BookInfoRemoteSearchQuery>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BookInfoRemoteSearchQuery::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,40 +32,41 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BoxSetInfo::BoxSetInfo(QObject *parent) {}
|
||||
BoxSetInfo::BoxSetInfo() {}
|
||||
|
||||
BoxSetInfo BoxSetInfo::fromJson(QJsonObject source) {BoxSetInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
BoxSetInfo BoxSetInfo::fromJson(QJsonObject source) {
|
||||
BoxSetInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BoxSetInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = fromJsonValue<bool>(source["IsAutomated"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
|
||||
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
|
||||
m_providerIds = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ProviderIds"]);
|
||||
m_year = Jellyfin::Support::fromJsonValue<qint32>(source["Year"]);
|
||||
m_indexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["IndexNumber"]);
|
||||
m_parentIndexNumber = Jellyfin::Support::fromJsonValue<qint32>(source["ParentIndexNumber"]);
|
||||
m_premiereDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PremiereDate"]);
|
||||
m_isAutomated = Jellyfin::Support::fromJsonValue<bool>(source["IsAutomated"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BoxSetInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = toJsonValue<bool>(m_isAutomated);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
|
||||
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
|
||||
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
|
||||
result["Year"] = Jellyfin::Support::toJsonValue<qint32>(m_year);
|
||||
result["IndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_indexNumber);
|
||||
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<qint32>(m_parentIndexNumber);
|
||||
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
|
||||
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -121,6 +122,17 @@ void BoxSetInfo::setIsAutomated(bool newIsAutomated) {
|
|||
m_isAutomated = newIsAutomated;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BoxSetInfo = Jellyfin::DTO::BoxSetInfo;
|
||||
|
||||
template <>
|
||||
BoxSetInfo fromJsonValue<BoxSetInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BoxSetInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BoxSetInfoRemoteSearchQuery::BoxSetInfoRemoteSearchQuery(QObject *parent) {}
|
||||
BoxSetInfoRemoteSearchQuery::BoxSetInfoRemoteSearchQuery() {}
|
||||
|
||||
BoxSetInfoRemoteSearchQuery BoxSetInfoRemoteSearchQuery::fromJson(QJsonObject source) {BoxSetInfoRemoteSearchQuery instance;
|
||||
instance->setFromJson(source, false);
|
||||
BoxSetInfoRemoteSearchQuery BoxSetInfoRemoteSearchQuery::fromJson(QJsonObject source) {
|
||||
BoxSetInfoRemoteSearchQuery instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BoxSetInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
|
||||
m_searchInfo = fromJsonValue<QSharedPointer<BoxSetInfo>>(source["SearchInfo"]);
|
||||
m_itemId = fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
m_searchInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<BoxSetInfo>>(source["SearchInfo"]);
|
||||
m_itemId = Jellyfin::Support::fromJsonValue<QUuid>(source["ItemId"]);
|
||||
m_searchProviderName = Jellyfin::Support::fromJsonValue<QString>(source["SearchProviderName"]);
|
||||
m_includeDisabledProviders = Jellyfin::Support::fromJsonValue<bool>(source["IncludeDisabledProviders"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BoxSetInfoRemoteSearchQuery::toJson() {
|
||||
QJsonObject result;
|
||||
result["SearchInfo"] = toJsonValue<QSharedPointer<BoxSetInfo>>(m_searchInfo);
|
||||
result["ItemId"] = toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = toJsonValue<bool>(m_includeDisabledProviders);
|
||||
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<BoxSetInfo>>(m_searchInfo);
|
||||
result["ItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_itemId);
|
||||
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
|
||||
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void BoxSetInfoRemoteSearchQuery::setIncludeDisabledProviders(bool newIncludeDis
|
|||
m_includeDisabledProviders = newIncludeDisabledProviders;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BoxSetInfoRemoteSearchQuery = Jellyfin::DTO::BoxSetInfoRemoteSearchQuery;
|
||||
|
||||
template <>
|
||||
BoxSetInfoRemoteSearchQuery fromJsonValue<BoxSetInfoRemoteSearchQuery>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BoxSetInfoRemoteSearchQuery::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BrandingOptions::BrandingOptions(QObject *parent) {}
|
||||
BrandingOptions::BrandingOptions() {}
|
||||
|
||||
BrandingOptions BrandingOptions::fromJson(QJsonObject source) {BrandingOptions instance;
|
||||
instance->setFromJson(source, false);
|
||||
BrandingOptions BrandingOptions::fromJson(QJsonObject source) {
|
||||
BrandingOptions instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BrandingOptions::setFromJson(QJsonObject source) {
|
||||
m_loginDisclaimer = fromJsonValue<QString>(source["LoginDisclaimer"]);
|
||||
m_customCss = fromJsonValue<QString>(source["CustomCss"]);
|
||||
m_loginDisclaimer = Jellyfin::Support::fromJsonValue<QString>(source["LoginDisclaimer"]);
|
||||
m_customCss = Jellyfin::Support::fromJsonValue<QString>(source["CustomCss"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BrandingOptions::toJson() {
|
||||
QJsonObject result;
|
||||
result["LoginDisclaimer"] = toJsonValue<QString>(m_loginDisclaimer);
|
||||
result["CustomCss"] = toJsonValue<QString>(m_customCss);
|
||||
result["LoginDisclaimer"] = Jellyfin::Support::toJsonValue<QString>(m_loginDisclaimer);
|
||||
result["CustomCss"] = Jellyfin::Support::toJsonValue<QString>(m_customCss);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void BrandingOptions::setCustomCss(QString newCustomCss) {
|
|||
m_customCss = newCustomCss;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BrandingOptions = Jellyfin::DTO::BrandingOptions;
|
||||
|
||||
template <>
|
||||
BrandingOptions fromJsonValue<BrandingOptions>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BrandingOptions::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BufferRequestDto::BufferRequestDto(QObject *parent) {}
|
||||
BufferRequestDto::BufferRequestDto() {}
|
||||
|
||||
BufferRequestDto BufferRequestDto::fromJson(QJsonObject source) {BufferRequestDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
BufferRequestDto BufferRequestDto::fromJson(QJsonObject source) {
|
||||
BufferRequestDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BufferRequestDto::setFromJson(QJsonObject source) {
|
||||
m_when = fromJsonValue<QDateTime>(source["When"]);
|
||||
m_positionTicks = fromJsonValue<qint64>(source["PositionTicks"]);
|
||||
m_isPlaying = fromJsonValue<bool>(source["IsPlaying"]);
|
||||
m_playlistItemId = fromJsonValue<QUuid>(source["PlaylistItemId"]);
|
||||
m_when = Jellyfin::Support::fromJsonValue<QDateTime>(source["When"]);
|
||||
m_positionTicks = Jellyfin::Support::fromJsonValue<qint64>(source["PositionTicks"]);
|
||||
m_isPlaying = Jellyfin::Support::fromJsonValue<bool>(source["IsPlaying"]);
|
||||
m_playlistItemId = Jellyfin::Support::fromJsonValue<QUuid>(source["PlaylistItemId"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BufferRequestDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["When"] = toJsonValue<QDateTime>(m_when);
|
||||
result["PositionTicks"] = toJsonValue<qint64>(m_positionTicks);
|
||||
result["IsPlaying"] = toJsonValue<bool>(m_isPlaying);
|
||||
result["PlaylistItemId"] = toJsonValue<QUuid>(m_playlistItemId);
|
||||
result["When"] = Jellyfin::Support::toJsonValue<QDateTime>(m_when);
|
||||
result["PositionTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_positionTicks);
|
||||
result["IsPlaying"] = Jellyfin::Support::toJsonValue<bool>(m_isPlaying);
|
||||
result["PlaylistItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_playlistItemId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void BufferRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) {
|
|||
m_playlistItemId = newPlaylistItemId;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using BufferRequestDto = Jellyfin::DTO::BufferRequestDto;
|
||||
|
||||
template <>
|
||||
BufferRequestDto fromJsonValue<BufferRequestDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return BufferRequestDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,44 +32,45 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ChannelFeatures::ChannelFeatures(QObject *parent) {}
|
||||
ChannelFeatures::ChannelFeatures() {}
|
||||
|
||||
ChannelFeatures ChannelFeatures::fromJson(QJsonObject source) {ChannelFeatures instance;
|
||||
instance->setFromJson(source, false);
|
||||
ChannelFeatures ChannelFeatures::fromJson(QJsonObject source) {
|
||||
ChannelFeatures instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ChannelFeatures::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_canSearch = fromJsonValue<bool>(source["CanSearch"]);
|
||||
m_mediaTypes = fromJsonValue<QList<ChannelMediaType>>(source["MediaTypes"]);
|
||||
m_contentTypes = fromJsonValue<QList<ChannelMediaContentType>>(source["ContentTypes"]);
|
||||
m_maxPageSize = fromJsonValue<qint32>(source["MaxPageSize"]);
|
||||
m_autoRefreshLevels = fromJsonValue<qint32>(source["AutoRefreshLevels"]);
|
||||
m_defaultSortFields = fromJsonValue<QList<ChannelItemSortField>>(source["DefaultSortFields"]);
|
||||
m_supportsSortOrderToggle = fromJsonValue<bool>(source["SupportsSortOrderToggle"]);
|
||||
m_supportsLatestMedia = fromJsonValue<bool>(source["SupportsLatestMedia"]);
|
||||
m_canFilter = fromJsonValue<bool>(source["CanFilter"]);
|
||||
m_supportsContentDownloading = fromJsonValue<bool>(source["SupportsContentDownloading"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_canSearch = Jellyfin::Support::fromJsonValue<bool>(source["CanSearch"]);
|
||||
m_mediaTypes = Jellyfin::Support::fromJsonValue<QList<ChannelMediaType>>(source["MediaTypes"]);
|
||||
m_contentTypes = Jellyfin::Support::fromJsonValue<QList<ChannelMediaContentType>>(source["ContentTypes"]);
|
||||
m_maxPageSize = Jellyfin::Support::fromJsonValue<qint32>(source["MaxPageSize"]);
|
||||
m_autoRefreshLevels = Jellyfin::Support::fromJsonValue<qint32>(source["AutoRefreshLevels"]);
|
||||
m_defaultSortFields = Jellyfin::Support::fromJsonValue<QList<ChannelItemSortField>>(source["DefaultSortFields"]);
|
||||
m_supportsSortOrderToggle = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSortOrderToggle"]);
|
||||
m_supportsLatestMedia = Jellyfin::Support::fromJsonValue<bool>(source["SupportsLatestMedia"]);
|
||||
m_canFilter = Jellyfin::Support::fromJsonValue<bool>(source["CanFilter"]);
|
||||
m_supportsContentDownloading = Jellyfin::Support::fromJsonValue<bool>(source["SupportsContentDownloading"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ChannelFeatures::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["CanSearch"] = toJsonValue<bool>(m_canSearch);
|
||||
result["MediaTypes"] = toJsonValue<QList<ChannelMediaType>>(m_mediaTypes);
|
||||
result["ContentTypes"] = toJsonValue<QList<ChannelMediaContentType>>(m_contentTypes);
|
||||
result["MaxPageSize"] = toJsonValue<qint32>(m_maxPageSize);
|
||||
result["AutoRefreshLevels"] = toJsonValue<qint32>(m_autoRefreshLevels);
|
||||
result["DefaultSortFields"] = toJsonValue<QList<ChannelItemSortField>>(m_defaultSortFields);
|
||||
result["SupportsSortOrderToggle"] = toJsonValue<bool>(m_supportsSortOrderToggle);
|
||||
result["SupportsLatestMedia"] = toJsonValue<bool>(m_supportsLatestMedia);
|
||||
result["CanFilter"] = toJsonValue<bool>(m_canFilter);
|
||||
result["SupportsContentDownloading"] = toJsonValue<bool>(m_supportsContentDownloading);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["CanSearch"] = Jellyfin::Support::toJsonValue<bool>(m_canSearch);
|
||||
result["MediaTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaType>>(m_mediaTypes);
|
||||
result["ContentTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaContentType>>(m_contentTypes);
|
||||
result["MaxPageSize"] = Jellyfin::Support::toJsonValue<qint32>(m_maxPageSize);
|
||||
result["AutoRefreshLevels"] = Jellyfin::Support::toJsonValue<qint32>(m_autoRefreshLevels);
|
||||
result["DefaultSortFields"] = Jellyfin::Support::toJsonValue<QList<ChannelItemSortField>>(m_defaultSortFields);
|
||||
result["SupportsSortOrderToggle"] = Jellyfin::Support::toJsonValue<bool>(m_supportsSortOrderToggle);
|
||||
result["SupportsLatestMedia"] = Jellyfin::Support::toJsonValue<bool>(m_supportsLatestMedia);
|
||||
result["CanFilter"] = Jellyfin::Support::toJsonValue<bool>(m_canFilter);
|
||||
result["SupportsContentDownloading"] = Jellyfin::Support::toJsonValue<bool>(m_supportsContentDownloading);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -135,6 +136,17 @@ void ChannelFeatures::setSupportsContentDownloading(bool newSupportsContentDownl
|
|||
m_supportsContentDownloading = newSupportsContentDownloading;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelFeatures = Jellyfin::DTO::ChannelFeatures;
|
||||
|
||||
template <>
|
||||
ChannelFeatures fromJsonValue<ChannelFeatures>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ChannelFeatures::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,42 @@ namespace DTO {
|
|||
|
||||
ChannelItemSortFieldClass::ChannelItemSortFieldClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelItemSortField = Jellyfin::DTO::ChannelItemSortField;
|
||||
|
||||
template <>
|
||||
ChannelItemSortField fromJsonValue<ChannelItemSortField>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ChannelItemSortField::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Name")) {
|
||||
return ChannelItemSortField::Name;
|
||||
}
|
||||
if (str == QStringLiteral("CommunityRating")) {
|
||||
return ChannelItemSortField::CommunityRating;
|
||||
}
|
||||
if (str == QStringLiteral("PremiereDate")) {
|
||||
return ChannelItemSortField::PremiereDate;
|
||||
}
|
||||
if (str == QStringLiteral("DateCreated")) {
|
||||
return ChannelItemSortField::DateCreated;
|
||||
}
|
||||
if (str == QStringLiteral("Runtime")) {
|
||||
return ChannelItemSortField::Runtime;
|
||||
}
|
||||
if (str == QStringLiteral("PlayCount")) {
|
||||
return ChannelItemSortField::PlayCount;
|
||||
}
|
||||
if (str == QStringLiteral("CommunityPlayCount")) {
|
||||
return ChannelItemSortField::CommunityPlayCount;
|
||||
}
|
||||
|
||||
return ChannelItemSortField::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ChannelMappingOptionsDto::ChannelMappingOptionsDto(QObject *parent) {}
|
||||
ChannelMappingOptionsDto::ChannelMappingOptionsDto() {}
|
||||
|
||||
ChannelMappingOptionsDto ChannelMappingOptionsDto::fromJson(QJsonObject source) {ChannelMappingOptionsDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
ChannelMappingOptionsDto ChannelMappingOptionsDto::fromJson(QJsonObject source) {
|
||||
ChannelMappingOptionsDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ChannelMappingOptionsDto::setFromJson(QJsonObject source) {
|
||||
m_tunerChannels = fromJsonValue<QList<QSharedPointer<TunerChannelMapping>>>(source["TunerChannels"]);
|
||||
m_providerChannels = fromJsonValue<QList<QSharedPointer<NameIdPair>>>(source["ProviderChannels"]);
|
||||
m_mappings = fromJsonValue<QList<QSharedPointer<NameValuePair>>>(source["Mappings"]);
|
||||
m_providerName = fromJsonValue<QString>(source["ProviderName"]);
|
||||
m_tunerChannels = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<TunerChannelMapping>>>(source["TunerChannels"]);
|
||||
m_providerChannels = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameIdPair>>>(source["ProviderChannels"]);
|
||||
m_mappings = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<NameValuePair>>>(source["Mappings"]);
|
||||
m_providerName = Jellyfin::Support::fromJsonValue<QString>(source["ProviderName"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ChannelMappingOptionsDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["TunerChannels"] = toJsonValue<QList<QSharedPointer<TunerChannelMapping>>>(m_tunerChannels);
|
||||
result["ProviderChannels"] = toJsonValue<QList<QSharedPointer<NameIdPair>>>(m_providerChannels);
|
||||
result["Mappings"] = toJsonValue<QList<QSharedPointer<NameValuePair>>>(m_mappings);
|
||||
result["ProviderName"] = toJsonValue<QString>(m_providerName);
|
||||
result["TunerChannels"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<TunerChannelMapping>>>(m_tunerChannels);
|
||||
result["ProviderChannels"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameIdPair>>>(m_providerChannels);
|
||||
result["Mappings"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<NameValuePair>>>(m_mappings);
|
||||
result["ProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_providerName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void ChannelMappingOptionsDto::setProviderName(QString newProviderName) {
|
|||
m_providerName = newProviderName;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelMappingOptionsDto = Jellyfin::DTO::ChannelMappingOptionsDto;
|
||||
|
||||
template <>
|
||||
ChannelMappingOptionsDto fromJsonValue<ChannelMappingOptionsDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ChannelMappingOptionsDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,45 @@ namespace DTO {
|
|||
|
||||
ChannelMediaContentTypeClass::ChannelMediaContentTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelMediaContentType = Jellyfin::DTO::ChannelMediaContentType;
|
||||
|
||||
template <>
|
||||
ChannelMediaContentType fromJsonValue<ChannelMediaContentType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ChannelMediaContentType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Clip")) {
|
||||
return ChannelMediaContentType::Clip;
|
||||
}
|
||||
if (str == QStringLiteral("Podcast")) {
|
||||
return ChannelMediaContentType::Podcast;
|
||||
}
|
||||
if (str == QStringLiteral("Trailer")) {
|
||||
return ChannelMediaContentType::Trailer;
|
||||
}
|
||||
if (str == QStringLiteral("Movie")) {
|
||||
return ChannelMediaContentType::Movie;
|
||||
}
|
||||
if (str == QStringLiteral("Episode")) {
|
||||
return ChannelMediaContentType::Episode;
|
||||
}
|
||||
if (str == QStringLiteral("Song")) {
|
||||
return ChannelMediaContentType::Song;
|
||||
}
|
||||
if (str == QStringLiteral("MovieExtra")) {
|
||||
return ChannelMediaContentType::MovieExtra;
|
||||
}
|
||||
if (str == QStringLiteral("TvExtra")) {
|
||||
return ChannelMediaContentType::TvExtra;
|
||||
}
|
||||
|
||||
return ChannelMediaContentType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
ChannelMediaTypeClass::ChannelMediaTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelMediaType = Jellyfin::DTO::ChannelMediaType;
|
||||
|
||||
template <>
|
||||
ChannelMediaType fromJsonValue<ChannelMediaType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ChannelMediaType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Audio")) {
|
||||
return ChannelMediaType::Audio;
|
||||
}
|
||||
if (str == QStringLiteral("Video")) {
|
||||
return ChannelMediaType::Video;
|
||||
}
|
||||
if (str == QStringLiteral("Photo")) {
|
||||
return ChannelMediaType::Photo;
|
||||
}
|
||||
|
||||
return ChannelMediaType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
ChannelTypeClass::ChannelTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChannelType = Jellyfin::DTO::ChannelType;
|
||||
|
||||
template <>
|
||||
ChannelType fromJsonValue<ChannelType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ChannelType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("TV")) {
|
||||
return ChannelType::TV;
|
||||
}
|
||||
if (str == QStringLiteral("Radio")) {
|
||||
return ChannelType::Radio;
|
||||
}
|
||||
|
||||
return ChannelType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ChapterInfo::ChapterInfo(QObject *parent) {}
|
||||
ChapterInfo::ChapterInfo() {}
|
||||
|
||||
ChapterInfo ChapterInfo::fromJson(QJsonObject source) {ChapterInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ChapterInfo ChapterInfo::fromJson(QJsonObject source) {
|
||||
ChapterInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ChapterInfo::setFromJson(QJsonObject source) {
|
||||
m_startPositionTicks = fromJsonValue<qint64>(source["StartPositionTicks"]);
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_imagePath = fromJsonValue<QString>(source["ImagePath"]);
|
||||
m_imageDateModified = fromJsonValue<QDateTime>(source["ImageDateModified"]);
|
||||
m_imageTag = fromJsonValue<QString>(source["ImageTag"]);
|
||||
m_startPositionTicks = Jellyfin::Support::fromJsonValue<qint64>(source["StartPositionTicks"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_imagePath = Jellyfin::Support::fromJsonValue<QString>(source["ImagePath"]);
|
||||
m_imageDateModified = Jellyfin::Support::fromJsonValue<QDateTime>(source["ImageDateModified"]);
|
||||
m_imageTag = Jellyfin::Support::fromJsonValue<QString>(source["ImageTag"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ChapterInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["StartPositionTicks"] = toJsonValue<qint64>(m_startPositionTicks);
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["ImagePath"] = toJsonValue<QString>(m_imagePath);
|
||||
result["ImageDateModified"] = toJsonValue<QDateTime>(m_imageDateModified);
|
||||
result["ImageTag"] = toJsonValue<QString>(m_imageTag);
|
||||
result["StartPositionTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_startPositionTicks);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["ImagePath"] = Jellyfin::Support::toJsonValue<QString>(m_imagePath);
|
||||
result["ImageDateModified"] = Jellyfin::Support::toJsonValue<QDateTime>(m_imageDateModified);
|
||||
result["ImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_imageTag);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void ChapterInfo::setImageTag(QString newImageTag) {
|
|||
m_imageTag = newImageTag;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ChapterInfo = Jellyfin::DTO::ChapterInfo;
|
||||
|
||||
template <>
|
||||
ChapterInfo fromJsonValue<ChapterInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ChapterInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,40 +32,41 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ClientCapabilities::ClientCapabilities(QObject *parent) {}
|
||||
ClientCapabilities::ClientCapabilities() {}
|
||||
|
||||
ClientCapabilities ClientCapabilities::fromJson(QJsonObject source) {ClientCapabilities instance;
|
||||
instance->setFromJson(source, false);
|
||||
ClientCapabilities ClientCapabilities::fromJson(QJsonObject source) {
|
||||
ClientCapabilities instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ClientCapabilities::setFromJson(QJsonObject source) {
|
||||
m_playableMediaTypes = fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
|
||||
m_supportedCommands = fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
|
||||
m_supportsMediaControl = fromJsonValue<bool>(source["SupportsMediaControl"]);
|
||||
m_supportsContentUploading = fromJsonValue<bool>(source["SupportsContentUploading"]);
|
||||
m_messageCallbackUrl = fromJsonValue<QString>(source["MessageCallbackUrl"]);
|
||||
m_supportsPersistentIdentifier = fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
|
||||
m_supportsSync = fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_deviceProfile = fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
|
||||
m_appStoreUrl = fromJsonValue<QString>(source["AppStoreUrl"]);
|
||||
m_iconUrl = fromJsonValue<QString>(source["IconUrl"]);
|
||||
m_playableMediaTypes = Jellyfin::Support::fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
|
||||
m_supportedCommands = Jellyfin::Support::fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
|
||||
m_supportsMediaControl = Jellyfin::Support::fromJsonValue<bool>(source["SupportsMediaControl"]);
|
||||
m_supportsContentUploading = Jellyfin::Support::fromJsonValue<bool>(source["SupportsContentUploading"]);
|
||||
m_messageCallbackUrl = Jellyfin::Support::fromJsonValue<QString>(source["MessageCallbackUrl"]);
|
||||
m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
|
||||
m_supportsSync = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_deviceProfile = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
|
||||
m_appStoreUrl = Jellyfin::Support::fromJsonValue<QString>(source["AppStoreUrl"]);
|
||||
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ClientCapabilities::toJson() {
|
||||
QJsonObject result;
|
||||
result["PlayableMediaTypes"] = toJsonValue<QStringList>(m_playableMediaTypes);
|
||||
result["SupportedCommands"] = toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
|
||||
result["SupportsMediaControl"] = toJsonValue<bool>(m_supportsMediaControl);
|
||||
result["SupportsContentUploading"] = toJsonValue<bool>(m_supportsContentUploading);
|
||||
result["MessageCallbackUrl"] = toJsonValue<QString>(m_messageCallbackUrl);
|
||||
result["SupportsPersistentIdentifier"] = toJsonValue<bool>(m_supportsPersistentIdentifier);
|
||||
result["SupportsSync"] = toJsonValue<bool>(m_supportsSync);
|
||||
result["DeviceProfile"] = toJsonValue<QSharedPointer<DeviceProfile>>(m_deviceProfile);
|
||||
result["AppStoreUrl"] = toJsonValue<QString>(m_appStoreUrl);
|
||||
result["IconUrl"] = toJsonValue<QString>(m_iconUrl);
|
||||
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
|
||||
result["SupportedCommands"] = Jellyfin::Support::toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
|
||||
result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue<bool>(m_supportsMediaControl);
|
||||
result["SupportsContentUploading"] = Jellyfin::Support::toJsonValue<bool>(m_supportsContentUploading);
|
||||
result["MessageCallbackUrl"] = Jellyfin::Support::toJsonValue<QString>(m_messageCallbackUrl);
|
||||
result["SupportsPersistentIdentifier"] = Jellyfin::Support::toJsonValue<bool>(m_supportsPersistentIdentifier);
|
||||
result["SupportsSync"] = Jellyfin::Support::toJsonValue<bool>(m_supportsSync);
|
||||
result["DeviceProfile"] = Jellyfin::Support::toJsonValue<QSharedPointer<DeviceProfile>>(m_deviceProfile);
|
||||
result["AppStoreUrl"] = Jellyfin::Support::toJsonValue<QString>(m_appStoreUrl);
|
||||
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -121,6 +122,17 @@ void ClientCapabilities::setIconUrl(QString newIconUrl) {
|
|||
m_iconUrl = newIconUrl;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ClientCapabilities = Jellyfin::DTO::ClientCapabilities;
|
||||
|
||||
template <>
|
||||
ClientCapabilities fromJsonValue<ClientCapabilities>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ClientCapabilities::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,40 +32,41 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ClientCapabilitiesDto::ClientCapabilitiesDto(QObject *parent) {}
|
||||
ClientCapabilitiesDto::ClientCapabilitiesDto() {}
|
||||
|
||||
ClientCapabilitiesDto ClientCapabilitiesDto::fromJson(QJsonObject source) {ClientCapabilitiesDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
ClientCapabilitiesDto ClientCapabilitiesDto::fromJson(QJsonObject source) {
|
||||
ClientCapabilitiesDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ClientCapabilitiesDto::setFromJson(QJsonObject source) {
|
||||
m_playableMediaTypes = fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
|
||||
m_supportedCommands = fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
|
||||
m_supportsMediaControl = fromJsonValue<bool>(source["SupportsMediaControl"]);
|
||||
m_supportsContentUploading = fromJsonValue<bool>(source["SupportsContentUploading"]);
|
||||
m_messageCallbackUrl = fromJsonValue<QString>(source["MessageCallbackUrl"]);
|
||||
m_supportsPersistentIdentifier = fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
|
||||
m_supportsSync = fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_deviceProfile = fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
|
||||
m_appStoreUrl = fromJsonValue<QString>(source["AppStoreUrl"]);
|
||||
m_iconUrl = fromJsonValue<QString>(source["IconUrl"]);
|
||||
m_playableMediaTypes = Jellyfin::Support::fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
|
||||
m_supportedCommands = Jellyfin::Support::fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
|
||||
m_supportsMediaControl = Jellyfin::Support::fromJsonValue<bool>(source["SupportsMediaControl"]);
|
||||
m_supportsContentUploading = Jellyfin::Support::fromJsonValue<bool>(source["SupportsContentUploading"]);
|
||||
m_messageCallbackUrl = Jellyfin::Support::fromJsonValue<QString>(source["MessageCallbackUrl"]);
|
||||
m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
|
||||
m_supportsSync = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSync"]);
|
||||
m_deviceProfile = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
|
||||
m_appStoreUrl = Jellyfin::Support::fromJsonValue<QString>(source["AppStoreUrl"]);
|
||||
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ClientCapabilitiesDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["PlayableMediaTypes"] = toJsonValue<QStringList>(m_playableMediaTypes);
|
||||
result["SupportedCommands"] = toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
|
||||
result["SupportsMediaControl"] = toJsonValue<bool>(m_supportsMediaControl);
|
||||
result["SupportsContentUploading"] = toJsonValue<bool>(m_supportsContentUploading);
|
||||
result["MessageCallbackUrl"] = toJsonValue<QString>(m_messageCallbackUrl);
|
||||
result["SupportsPersistentIdentifier"] = toJsonValue<bool>(m_supportsPersistentIdentifier);
|
||||
result["SupportsSync"] = toJsonValue<bool>(m_supportsSync);
|
||||
result["DeviceProfile"] = toJsonValue<QSharedPointer<DeviceProfile>>(m_deviceProfile);
|
||||
result["AppStoreUrl"] = toJsonValue<QString>(m_appStoreUrl);
|
||||
result["IconUrl"] = toJsonValue<QString>(m_iconUrl);
|
||||
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
|
||||
result["SupportedCommands"] = Jellyfin::Support::toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
|
||||
result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue<bool>(m_supportsMediaControl);
|
||||
result["SupportsContentUploading"] = Jellyfin::Support::toJsonValue<bool>(m_supportsContentUploading);
|
||||
result["MessageCallbackUrl"] = Jellyfin::Support::toJsonValue<QString>(m_messageCallbackUrl);
|
||||
result["SupportsPersistentIdentifier"] = Jellyfin::Support::toJsonValue<bool>(m_supportsPersistentIdentifier);
|
||||
result["SupportsSync"] = Jellyfin::Support::toJsonValue<bool>(m_supportsSync);
|
||||
result["DeviceProfile"] = Jellyfin::Support::toJsonValue<QSharedPointer<DeviceProfile>>(m_deviceProfile);
|
||||
result["AppStoreUrl"] = Jellyfin::Support::toJsonValue<QString>(m_appStoreUrl);
|
||||
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -121,6 +122,17 @@ void ClientCapabilitiesDto::setIconUrl(QString newIconUrl) {
|
|||
m_iconUrl = newIconUrl;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ClientCapabilitiesDto = Jellyfin::DTO::ClientCapabilitiesDto;
|
||||
|
||||
template <>
|
||||
ClientCapabilitiesDto fromJsonValue<ClientCapabilitiesDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ClientCapabilitiesDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CodecProfile::CodecProfile(QObject *parent) {}
|
||||
CodecProfile::CodecProfile() {}
|
||||
|
||||
CodecProfile CodecProfile::fromJson(QJsonObject source) {CodecProfile instance;
|
||||
instance->setFromJson(source, false);
|
||||
CodecProfile CodecProfile::fromJson(QJsonObject source) {
|
||||
CodecProfile instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CodecProfile::setFromJson(QJsonObject source) {
|
||||
m_type = fromJsonValue<CodecType>(source["Type"]);
|
||||
m_conditions = fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["Conditions"]);
|
||||
m_applyConditions = fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["ApplyConditions"]);
|
||||
m_codec = fromJsonValue<QString>(source["Codec"]);
|
||||
m_container = fromJsonValue<QString>(source["Container"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<CodecType>(source["Type"]);
|
||||
m_conditions = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["Conditions"]);
|
||||
m_applyConditions = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["ApplyConditions"]);
|
||||
m_codec = Jellyfin::Support::fromJsonValue<QString>(source["Codec"]);
|
||||
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CodecProfile::toJson() {
|
||||
QJsonObject result;
|
||||
result["Type"] = toJsonValue<CodecType>(m_type);
|
||||
result["Conditions"] = toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_conditions);
|
||||
result["ApplyConditions"] = toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_applyConditions);
|
||||
result["Codec"] = toJsonValue<QString>(m_codec);
|
||||
result["Container"] = toJsonValue<QString>(m_container);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<CodecType>(m_type);
|
||||
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_conditions);
|
||||
result["ApplyConditions"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_applyConditions);
|
||||
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
|
||||
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void CodecProfile::setContainer(QString newContainer) {
|
|||
m_container = newContainer;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CodecProfile = Jellyfin::DTO::CodecProfile;
|
||||
|
||||
template <>
|
||||
CodecProfile fromJsonValue<CodecProfile>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CodecProfile::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
CodecTypeClass::CodecTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CodecType = Jellyfin::DTO::CodecType;
|
||||
|
||||
template <>
|
||||
CodecType fromJsonValue<CodecType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return CodecType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Video")) {
|
||||
return CodecType::Video;
|
||||
}
|
||||
if (str == QStringLiteral("VideoAudio")) {
|
||||
return CodecType::VideoAudio;
|
||||
}
|
||||
if (str == QStringLiteral("Audio")) {
|
||||
return CodecType::Audio;
|
||||
}
|
||||
|
||||
return CodecType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CollectionCreationResult::CollectionCreationResult(QObject *parent) {}
|
||||
CollectionCreationResult::CollectionCreationResult() {}
|
||||
|
||||
CollectionCreationResult CollectionCreationResult::fromJson(QJsonObject source) {CollectionCreationResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
CollectionCreationResult CollectionCreationResult::fromJson(QJsonObject source) {
|
||||
CollectionCreationResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CollectionCreationResult::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<QUuid>(source["Id"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QUuid>(source["Id"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CollectionCreationResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<QUuid>(m_jellyfinId);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QUuid>(m_jellyfinId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void CollectionCreationResult::setJellyfinId(QUuid newJellyfinId) {
|
|||
m_jellyfinId = newJellyfinId;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CollectionCreationResult = Jellyfin::DTO::CollectionCreationResult;
|
||||
|
||||
template <>
|
||||
CollectionCreationResult fromJsonValue<CollectionCreationResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CollectionCreationResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,34 +32,35 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ConfigurationPageInfo::ConfigurationPageInfo(QObject *parent) {}
|
||||
ConfigurationPageInfo::ConfigurationPageInfo() {}
|
||||
|
||||
ConfigurationPageInfo ConfigurationPageInfo::fromJson(QJsonObject source) {ConfigurationPageInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ConfigurationPageInfo ConfigurationPageInfo::fromJson(QJsonObject source) {
|
||||
ConfigurationPageInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ConfigurationPageInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_enableInMainMenu = fromJsonValue<bool>(source["EnableInMainMenu"]);
|
||||
m_menuSection = fromJsonValue<QString>(source["MenuSection"]);
|
||||
m_menuIcon = fromJsonValue<QString>(source["MenuIcon"]);
|
||||
m_displayName = fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_configurationPageType = fromJsonValue<ConfigurationPageType>(source["ConfigurationPageType"]);
|
||||
m_pluginId = fromJsonValue<QUuid>(source["PluginId"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_enableInMainMenu = Jellyfin::Support::fromJsonValue<bool>(source["EnableInMainMenu"]);
|
||||
m_menuSection = Jellyfin::Support::fromJsonValue<QString>(source["MenuSection"]);
|
||||
m_menuIcon = Jellyfin::Support::fromJsonValue<QString>(source["MenuIcon"]);
|
||||
m_displayName = Jellyfin::Support::fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_configurationPageType = Jellyfin::Support::fromJsonValue<ConfigurationPageType>(source["ConfigurationPageType"]);
|
||||
m_pluginId = Jellyfin::Support::fromJsonValue<QUuid>(source["PluginId"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ConfigurationPageInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["EnableInMainMenu"] = toJsonValue<bool>(m_enableInMainMenu);
|
||||
result["MenuSection"] = toJsonValue<QString>(m_menuSection);
|
||||
result["MenuIcon"] = toJsonValue<QString>(m_menuIcon);
|
||||
result["DisplayName"] = toJsonValue<QString>(m_displayName);
|
||||
result["ConfigurationPageType"] = toJsonValue<ConfigurationPageType>(m_configurationPageType);
|
||||
result["PluginId"] = toJsonValue<QUuid>(m_pluginId);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["EnableInMainMenu"] = Jellyfin::Support::toJsonValue<bool>(m_enableInMainMenu);
|
||||
result["MenuSection"] = Jellyfin::Support::toJsonValue<QString>(m_menuSection);
|
||||
result["MenuIcon"] = Jellyfin::Support::toJsonValue<QString>(m_menuIcon);
|
||||
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
|
||||
result["ConfigurationPageType"] = Jellyfin::Support::toJsonValue<ConfigurationPageType>(m_configurationPageType);
|
||||
result["PluginId"] = Jellyfin::Support::toJsonValue<QUuid>(m_pluginId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -100,6 +101,17 @@ void ConfigurationPageInfo::setPluginId(QUuid newPluginId) {
|
|||
m_pluginId = newPluginId;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ConfigurationPageInfo = Jellyfin::DTO::ConfigurationPageInfo;
|
||||
|
||||
template <>
|
||||
ConfigurationPageInfo fromJsonValue<ConfigurationPageInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ConfigurationPageInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
ConfigurationPageTypeClass::ConfigurationPageTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType;
|
||||
|
||||
template <>
|
||||
ConfigurationPageType fromJsonValue<ConfigurationPageType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ConfigurationPageType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("PluginConfiguration")) {
|
||||
return ConfigurationPageType::PluginConfiguration;
|
||||
}
|
||||
if (str == QStringLiteral("None")) {
|
||||
return ConfigurationPageType::None;
|
||||
}
|
||||
|
||||
return ConfigurationPageType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ContainerProfile::ContainerProfile(QObject *parent) {}
|
||||
ContainerProfile::ContainerProfile() {}
|
||||
|
||||
ContainerProfile ContainerProfile::fromJson(QJsonObject source) {ContainerProfile instance;
|
||||
instance->setFromJson(source, false);
|
||||
ContainerProfile ContainerProfile::fromJson(QJsonObject source) {
|
||||
ContainerProfile instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ContainerProfile::setFromJson(QJsonObject source) {
|
||||
m_type = fromJsonValue<DlnaProfileType>(source["Type"]);
|
||||
m_conditions = fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["Conditions"]);
|
||||
m_container = fromJsonValue<QString>(source["Container"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<DlnaProfileType>(source["Type"]);
|
||||
m_conditions = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ProfileCondition>>>(source["Conditions"]);
|
||||
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ContainerProfile::toJson() {
|
||||
QJsonObject result;
|
||||
result["Type"] = toJsonValue<DlnaProfileType>(m_type);
|
||||
result["Conditions"] = toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_conditions);
|
||||
result["Container"] = toJsonValue<QString>(m_container);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<DlnaProfileType>(m_type);
|
||||
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ProfileCondition>>>(m_conditions);
|
||||
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void ContainerProfile::setContainer(QString newContainer) {
|
|||
m_container = newContainer;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ContainerProfile = Jellyfin::DTO::ContainerProfile;
|
||||
|
||||
template <>
|
||||
ContainerProfile fromJsonValue<ContainerProfile>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ContainerProfile::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ControlResponse::ControlResponse(QObject *parent) {}
|
||||
ControlResponse::ControlResponse() {}
|
||||
|
||||
ControlResponse ControlResponse::fromJson(QJsonObject source) {ControlResponse instance;
|
||||
instance->setFromJson(source, false);
|
||||
ControlResponse ControlResponse::fromJson(QJsonObject source) {
|
||||
ControlResponse instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ControlResponse::setFromJson(QJsonObject source) {
|
||||
m_headers = fromJsonValue<QJsonObject>(source["Headers"]);
|
||||
m_xml = fromJsonValue<QString>(source["Xml"]);
|
||||
m_isSuccessful = fromJsonValue<bool>(source["IsSuccessful"]);
|
||||
m_headers = Jellyfin::Support::fromJsonValue<QJsonObject>(source["Headers"]);
|
||||
m_xml = Jellyfin::Support::fromJsonValue<QString>(source["Xml"]);
|
||||
m_isSuccessful = Jellyfin::Support::fromJsonValue<bool>(source["IsSuccessful"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ControlResponse::toJson() {
|
||||
QJsonObject result;
|
||||
result["Headers"] = toJsonValue<QJsonObject>(m_headers);
|
||||
result["Xml"] = toJsonValue<QString>(m_xml);
|
||||
result["IsSuccessful"] = toJsonValue<bool>(m_isSuccessful);
|
||||
result["Headers"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_headers);
|
||||
result["Xml"] = Jellyfin::Support::toJsonValue<QString>(m_xml);
|
||||
result["IsSuccessful"] = Jellyfin::Support::toJsonValue<bool>(m_isSuccessful);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void ControlResponse::setIsSuccessful(bool newIsSuccessful) {
|
|||
m_isSuccessful = newIsSuccessful;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ControlResponse = Jellyfin::DTO::ControlResponse;
|
||||
|
||||
template <>
|
||||
ControlResponse fromJsonValue<ControlResponse>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ControlResponse::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CountryInfo::CountryInfo(QObject *parent) {}
|
||||
CountryInfo::CountryInfo() {}
|
||||
|
||||
CountryInfo CountryInfo::fromJson(QJsonObject source) {CountryInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
CountryInfo CountryInfo::fromJson(QJsonObject source) {
|
||||
CountryInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CountryInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_displayName = fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_twoLetterISORegionName = fromJsonValue<QString>(source["TwoLetterISORegionName"]);
|
||||
m_threeLetterISORegionName = fromJsonValue<QString>(source["ThreeLetterISORegionName"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_displayName = Jellyfin::Support::fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_twoLetterISORegionName = Jellyfin::Support::fromJsonValue<QString>(source["TwoLetterISORegionName"]);
|
||||
m_threeLetterISORegionName = Jellyfin::Support::fromJsonValue<QString>(source["ThreeLetterISORegionName"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CountryInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["DisplayName"] = toJsonValue<QString>(m_displayName);
|
||||
result["TwoLetterISORegionName"] = toJsonValue<QString>(m_twoLetterISORegionName);
|
||||
result["ThreeLetterISORegionName"] = toJsonValue<QString>(m_threeLetterISORegionName);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
|
||||
result["TwoLetterISORegionName"] = Jellyfin::Support::toJsonValue<QString>(m_twoLetterISORegionName);
|
||||
result["ThreeLetterISORegionName"] = Jellyfin::Support::toJsonValue<QString>(m_threeLetterISORegionName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void CountryInfo::setThreeLetterISORegionName(QString newThreeLetterISORegionNam
|
|||
m_threeLetterISORegionName = newThreeLetterISORegionName;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CountryInfo = Jellyfin::DTO::CountryInfo;
|
||||
|
||||
template <>
|
||||
CountryInfo fromJsonValue<CountryInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CountryInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CreatePlaylistDto::CreatePlaylistDto(QObject *parent) {}
|
||||
CreatePlaylistDto::CreatePlaylistDto() {}
|
||||
|
||||
CreatePlaylistDto CreatePlaylistDto::fromJson(QJsonObject source) {CreatePlaylistDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
CreatePlaylistDto CreatePlaylistDto::fromJson(QJsonObject source) {
|
||||
CreatePlaylistDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CreatePlaylistDto::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_ids = fromJsonValue<QList<QUuid>>(source["Ids"]);
|
||||
m_userId = fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_mediaType = fromJsonValue<QString>(source["MediaType"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_ids = Jellyfin::Support::fromJsonValue<QList<QUuid>>(source["Ids"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_mediaType = Jellyfin::Support::fromJsonValue<QString>(source["MediaType"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CreatePlaylistDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Ids"] = toJsonValue<QList<QUuid>>(m_ids);
|
||||
result["UserId"] = toJsonValue<QUuid>(m_userId);
|
||||
result["MediaType"] = toJsonValue<QString>(m_mediaType);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Ids"] = Jellyfin::Support::toJsonValue<QList<QUuid>>(m_ids);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_userId);
|
||||
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void CreatePlaylistDto::setMediaType(QString newMediaType) {
|
|||
m_mediaType = newMediaType;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CreatePlaylistDto = Jellyfin::DTO::CreatePlaylistDto;
|
||||
|
||||
template <>
|
||||
CreatePlaylistDto fromJsonValue<CreatePlaylistDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CreatePlaylistDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CreateUserByName::CreateUserByName(QObject *parent) {}
|
||||
CreateUserByName::CreateUserByName() {}
|
||||
|
||||
CreateUserByName CreateUserByName::fromJson(QJsonObject source) {CreateUserByName instance;
|
||||
instance->setFromJson(source, false);
|
||||
CreateUserByName CreateUserByName::fromJson(QJsonObject source) {
|
||||
CreateUserByName instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CreateUserByName::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_password = fromJsonValue<QString>(source["Password"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_password = Jellyfin::Support::fromJsonValue<QString>(source["Password"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CreateUserByName::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Password"] = toJsonValue<QString>(m_password);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void CreateUserByName::setPassword(QString newPassword) {
|
|||
m_password = newPassword;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CreateUserByName = Jellyfin::DTO::CreateUserByName;
|
||||
|
||||
template <>
|
||||
CreateUserByName fromJsonValue<CreateUserByName>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CreateUserByName::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
CultureDto::CultureDto(QObject *parent) {}
|
||||
CultureDto::CultureDto() {}
|
||||
|
||||
CultureDto CultureDto::fromJson(QJsonObject source) {CultureDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
CultureDto CultureDto::fromJson(QJsonObject source) {
|
||||
CultureDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void CultureDto::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_displayName = fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_twoLetterISOLanguageName = fromJsonValue<QString>(source["TwoLetterISOLanguageName"]);
|
||||
m_threeLetterISOLanguageName = fromJsonValue<QString>(source["ThreeLetterISOLanguageName"]);
|
||||
m_threeLetterISOLanguageNames = fromJsonValue<QStringList>(source["ThreeLetterISOLanguageNames"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_displayName = Jellyfin::Support::fromJsonValue<QString>(source["DisplayName"]);
|
||||
m_twoLetterISOLanguageName = Jellyfin::Support::fromJsonValue<QString>(source["TwoLetterISOLanguageName"]);
|
||||
m_threeLetterISOLanguageName = Jellyfin::Support::fromJsonValue<QString>(source["ThreeLetterISOLanguageName"]);
|
||||
m_threeLetterISOLanguageNames = Jellyfin::Support::fromJsonValue<QStringList>(source["ThreeLetterISOLanguageNames"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject CultureDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["DisplayName"] = toJsonValue<QString>(m_displayName);
|
||||
result["TwoLetterISOLanguageName"] = toJsonValue<QString>(m_twoLetterISOLanguageName);
|
||||
result["ThreeLetterISOLanguageName"] = toJsonValue<QString>(m_threeLetterISOLanguageName);
|
||||
result["ThreeLetterISOLanguageNames"] = toJsonValue<QStringList>(m_threeLetterISOLanguageNames);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
|
||||
result["TwoLetterISOLanguageName"] = Jellyfin::Support::toJsonValue<QString>(m_twoLetterISOLanguageName);
|
||||
result["ThreeLetterISOLanguageName"] = Jellyfin::Support::toJsonValue<QString>(m_threeLetterISOLanguageName);
|
||||
result["ThreeLetterISOLanguageNames"] = Jellyfin::Support::toJsonValue<QStringList>(m_threeLetterISOLanguageNames);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void CultureDto::setThreeLetterISOLanguageNames(QStringList newThreeLetterISOLan
|
|||
m_threeLetterISOLanguageNames = newThreeLetterISOLanguageNames;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using CultureDto = Jellyfin::DTO::CultureDto;
|
||||
|
||||
template <>
|
||||
CultureDto fromJsonValue<CultureDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return CultureDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,42 @@ namespace DTO {
|
|||
|
||||
DayOfWeekClass::DayOfWeekClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DayOfWeek = Jellyfin::DTO::DayOfWeek;
|
||||
|
||||
template <>
|
||||
DayOfWeek fromJsonValue<DayOfWeek>(const QJsonValue &source) {
|
||||
if (!source.isString()) return DayOfWeek::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Sunday")) {
|
||||
return DayOfWeek::Sunday;
|
||||
}
|
||||
if (str == QStringLiteral("Monday")) {
|
||||
return DayOfWeek::Monday;
|
||||
}
|
||||
if (str == QStringLiteral("Tuesday")) {
|
||||
return DayOfWeek::Tuesday;
|
||||
}
|
||||
if (str == QStringLiteral("Wednesday")) {
|
||||
return DayOfWeek::Wednesday;
|
||||
}
|
||||
if (str == QStringLiteral("Thursday")) {
|
||||
return DayOfWeek::Thursday;
|
||||
}
|
||||
if (str == QStringLiteral("Friday")) {
|
||||
return DayOfWeek::Friday;
|
||||
}
|
||||
if (str == QStringLiteral("Saturday")) {
|
||||
return DayOfWeek::Saturday;
|
||||
}
|
||||
|
||||
return DayOfWeek::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
DayPatternClass::DayPatternClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DayPattern = Jellyfin::DTO::DayPattern;
|
||||
|
||||
template <>
|
||||
DayPattern fromJsonValue<DayPattern>(const QJsonValue &source) {
|
||||
if (!source.isString()) return DayPattern::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Daily")) {
|
||||
return DayPattern::Daily;
|
||||
}
|
||||
if (str == QStringLiteral("Weekdays")) {
|
||||
return DayPattern::Weekdays;
|
||||
}
|
||||
if (str == QStringLiteral("Weekends")) {
|
||||
return DayPattern::Weekends;
|
||||
}
|
||||
|
||||
return DayPattern::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DefaultDirectoryBrowserInfoDto::DefaultDirectoryBrowserInfoDto(QObject *parent) {}
|
||||
DefaultDirectoryBrowserInfoDto::DefaultDirectoryBrowserInfoDto() {}
|
||||
|
||||
DefaultDirectoryBrowserInfoDto DefaultDirectoryBrowserInfoDto::fromJson(QJsonObject source) {DefaultDirectoryBrowserInfoDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
DefaultDirectoryBrowserInfoDto DefaultDirectoryBrowserInfoDto::fromJson(QJsonObject source) {
|
||||
DefaultDirectoryBrowserInfoDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DefaultDirectoryBrowserInfoDto::setFromJson(QJsonObject source) {
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DefaultDirectoryBrowserInfoDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void DefaultDirectoryBrowserInfoDto::setPath(QString newPath) {
|
|||
m_path = newPath;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DefaultDirectoryBrowserInfoDto = Jellyfin::DTO::DefaultDirectoryBrowserInfoDto;
|
||||
|
||||
template <>
|
||||
DefaultDirectoryBrowserInfoDto fromJsonValue<DefaultDirectoryBrowserInfoDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DefaultDirectoryBrowserInfoDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,38 +32,39 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceIdentification::DeviceIdentification(QObject *parent) {}
|
||||
DeviceIdentification::DeviceIdentification() {}
|
||||
|
||||
DeviceIdentification DeviceIdentification::fromJson(QJsonObject source) {DeviceIdentification instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceIdentification DeviceIdentification::fromJson(QJsonObject source) {
|
||||
DeviceIdentification instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceIdentification::setFromJson(QJsonObject source) {
|
||||
m_friendlyName = fromJsonValue<QString>(source["FriendlyName"]);
|
||||
m_modelNumber = fromJsonValue<QString>(source["ModelNumber"]);
|
||||
m_serialNumber = fromJsonValue<QString>(source["SerialNumber"]);
|
||||
m_modelName = fromJsonValue<QString>(source["ModelName"]);
|
||||
m_modelDescription = fromJsonValue<QString>(source["ModelDescription"]);
|
||||
m_modelUrl = fromJsonValue<QString>(source["ModelUrl"]);
|
||||
m_manufacturer = fromJsonValue<QString>(source["Manufacturer"]);
|
||||
m_manufacturerUrl = fromJsonValue<QString>(source["ManufacturerUrl"]);
|
||||
m_headers = fromJsonValue<QList<QSharedPointer<HttpHeaderInfo>>>(source["Headers"]);
|
||||
m_friendlyName = Jellyfin::Support::fromJsonValue<QString>(source["FriendlyName"]);
|
||||
m_modelNumber = Jellyfin::Support::fromJsonValue<QString>(source["ModelNumber"]);
|
||||
m_serialNumber = Jellyfin::Support::fromJsonValue<QString>(source["SerialNumber"]);
|
||||
m_modelName = Jellyfin::Support::fromJsonValue<QString>(source["ModelName"]);
|
||||
m_modelDescription = Jellyfin::Support::fromJsonValue<QString>(source["ModelDescription"]);
|
||||
m_modelUrl = Jellyfin::Support::fromJsonValue<QString>(source["ModelUrl"]);
|
||||
m_manufacturer = Jellyfin::Support::fromJsonValue<QString>(source["Manufacturer"]);
|
||||
m_manufacturerUrl = Jellyfin::Support::fromJsonValue<QString>(source["ManufacturerUrl"]);
|
||||
m_headers = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<HttpHeaderInfo>>>(source["Headers"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceIdentification::toJson() {
|
||||
QJsonObject result;
|
||||
result["FriendlyName"] = toJsonValue<QString>(m_friendlyName);
|
||||
result["ModelNumber"] = toJsonValue<QString>(m_modelNumber);
|
||||
result["SerialNumber"] = toJsonValue<QString>(m_serialNumber);
|
||||
result["ModelName"] = toJsonValue<QString>(m_modelName);
|
||||
result["ModelDescription"] = toJsonValue<QString>(m_modelDescription);
|
||||
result["ModelUrl"] = toJsonValue<QString>(m_modelUrl);
|
||||
result["Manufacturer"] = toJsonValue<QString>(m_manufacturer);
|
||||
result["ManufacturerUrl"] = toJsonValue<QString>(m_manufacturerUrl);
|
||||
result["Headers"] = toJsonValue<QList<QSharedPointer<HttpHeaderInfo>>>(m_headers);
|
||||
result["FriendlyName"] = Jellyfin::Support::toJsonValue<QString>(m_friendlyName);
|
||||
result["ModelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_modelNumber);
|
||||
result["SerialNumber"] = Jellyfin::Support::toJsonValue<QString>(m_serialNumber);
|
||||
result["ModelName"] = Jellyfin::Support::toJsonValue<QString>(m_modelName);
|
||||
result["ModelDescription"] = Jellyfin::Support::toJsonValue<QString>(m_modelDescription);
|
||||
result["ModelUrl"] = Jellyfin::Support::toJsonValue<QString>(m_modelUrl);
|
||||
result["Manufacturer"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturer);
|
||||
result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturerUrl);
|
||||
result["Headers"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<HttpHeaderInfo>>>(m_headers);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -114,6 +115,17 @@ void DeviceIdentification::setHeaders(QList<QSharedPointer<HttpHeaderInfo>> newH
|
|||
m_headers = newHeaders;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceIdentification = Jellyfin::DTO::DeviceIdentification;
|
||||
|
||||
template <>
|
||||
DeviceIdentification fromJsonValue<DeviceIdentification>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceIdentification::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,38 +32,39 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceInfo::DeviceInfo(QObject *parent) {}
|
||||
DeviceInfo::DeviceInfo() {}
|
||||
|
||||
DeviceInfo DeviceInfo::fromJson(QJsonObject source) {DeviceInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceInfo DeviceInfo::fromJson(QJsonObject source) {
|
||||
DeviceInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_lastUserName = fromJsonValue<QString>(source["LastUserName"]);
|
||||
m_appName = fromJsonValue<QString>(source["AppName"]);
|
||||
m_appVersion = fromJsonValue<QString>(source["AppVersion"]);
|
||||
m_lastUserId = fromJsonValue<QUuid>(source["LastUserId"]);
|
||||
m_dateLastActivity = fromJsonValue<QDateTime>(source["DateLastActivity"]);
|
||||
m_capabilities = fromJsonValue<QSharedPointer<ClientCapabilities>>(source["Capabilities"]);
|
||||
m_iconUrl = fromJsonValue<QString>(source["IconUrl"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_lastUserName = Jellyfin::Support::fromJsonValue<QString>(source["LastUserName"]);
|
||||
m_appName = Jellyfin::Support::fromJsonValue<QString>(source["AppName"]);
|
||||
m_appVersion = Jellyfin::Support::fromJsonValue<QString>(source["AppVersion"]);
|
||||
m_lastUserId = Jellyfin::Support::fromJsonValue<QUuid>(source["LastUserId"]);
|
||||
m_dateLastActivity = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastActivity"]);
|
||||
m_capabilities = Jellyfin::Support::fromJsonValue<QSharedPointer<ClientCapabilities>>(source["Capabilities"]);
|
||||
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["LastUserName"] = toJsonValue<QString>(m_lastUserName);
|
||||
result["AppName"] = toJsonValue<QString>(m_appName);
|
||||
result["AppVersion"] = toJsonValue<QString>(m_appVersion);
|
||||
result["LastUserId"] = toJsonValue<QUuid>(m_lastUserId);
|
||||
result["DateLastActivity"] = toJsonValue<QDateTime>(m_dateLastActivity);
|
||||
result["Capabilities"] = toJsonValue<QSharedPointer<ClientCapabilities>>(m_capabilities);
|
||||
result["IconUrl"] = toJsonValue<QString>(m_iconUrl);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["LastUserName"] = Jellyfin::Support::toJsonValue<QString>(m_lastUserName);
|
||||
result["AppName"] = Jellyfin::Support::toJsonValue<QString>(m_appName);
|
||||
result["AppVersion"] = Jellyfin::Support::toJsonValue<QString>(m_appVersion);
|
||||
result["LastUserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_lastUserId);
|
||||
result["DateLastActivity"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastActivity);
|
||||
result["Capabilities"] = Jellyfin::Support::toJsonValue<QSharedPointer<ClientCapabilities>>(m_capabilities);
|
||||
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -114,6 +115,17 @@ void DeviceInfo::setIconUrl(QString newIconUrl) {
|
|||
m_iconUrl = newIconUrl;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceInfo = Jellyfin::DTO::DeviceInfo;
|
||||
|
||||
template <>
|
||||
DeviceInfo fromJsonValue<DeviceInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceInfoQueryResult::DeviceInfoQueryResult(QObject *parent) {}
|
||||
DeviceInfoQueryResult::DeviceInfoQueryResult() {}
|
||||
|
||||
DeviceInfoQueryResult DeviceInfoQueryResult::fromJson(QJsonObject source) {DeviceInfoQueryResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceInfoQueryResult DeviceInfoQueryResult::fromJson(QJsonObject source) {
|
||||
DeviceInfoQueryResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceInfoQueryResult::setFromJson(QJsonObject source) {
|
||||
m_items = fromJsonValue<QList<QSharedPointer<DeviceInfo>>>(source["Items"]);
|
||||
m_totalRecordCount = fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_items = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<DeviceInfo>>>(source["Items"]);
|
||||
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
|
||||
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceInfoQueryResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Items"] = toJsonValue<QList<QSharedPointer<DeviceInfo>>>(m_items);
|
||||
result["TotalRecordCount"] = toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = toJsonValue<qint32>(m_startIndex);
|
||||
result["Items"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<DeviceInfo>>>(m_items);
|
||||
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
|
||||
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void DeviceInfoQueryResult::setStartIndex(qint32 newStartIndex) {
|
|||
m_startIndex = newStartIndex;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult;
|
||||
|
||||
template <>
|
||||
DeviceInfoQueryResult fromJsonValue<DeviceInfoQueryResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceInfoQueryResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceOptions::DeviceOptions(QObject *parent) {}
|
||||
DeviceOptions::DeviceOptions() {}
|
||||
|
||||
DeviceOptions DeviceOptions::fromJson(QJsonObject source) {DeviceOptions instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceOptions DeviceOptions::fromJson(QJsonObject source) {
|
||||
DeviceOptions instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceOptions::setFromJson(QJsonObject source) {
|
||||
m_customName = fromJsonValue<QString>(source["CustomName"]);
|
||||
m_customName = Jellyfin::Support::fromJsonValue<QString>(source["CustomName"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceOptions::toJson() {
|
||||
QJsonObject result;
|
||||
result["CustomName"] = toJsonValue<QString>(m_customName);
|
||||
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void DeviceOptions::setCustomName(QString newCustomName) {
|
|||
m_customName = newCustomName;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceOptions = Jellyfin::DTO::DeviceOptions;
|
||||
|
||||
template <>
|
||||
DeviceOptions fromJsonValue<DeviceOptions>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceOptions::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,98 +32,99 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceProfile::DeviceProfile(QObject *parent) {}
|
||||
DeviceProfile::DeviceProfile() {}
|
||||
|
||||
DeviceProfile DeviceProfile::fromJson(QJsonObject source) {DeviceProfile instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceProfile DeviceProfile::fromJson(QJsonObject source) {
|
||||
DeviceProfile instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceProfile::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_identification = fromJsonValue<QSharedPointer<DeviceIdentification>>(source["Identification"]);
|
||||
m_friendlyName = fromJsonValue<QString>(source["FriendlyName"]);
|
||||
m_manufacturer = fromJsonValue<QString>(source["Manufacturer"]);
|
||||
m_manufacturerUrl = fromJsonValue<QString>(source["ManufacturerUrl"]);
|
||||
m_modelName = fromJsonValue<QString>(source["ModelName"]);
|
||||
m_modelDescription = fromJsonValue<QString>(source["ModelDescription"]);
|
||||
m_modelNumber = fromJsonValue<QString>(source["ModelNumber"]);
|
||||
m_modelUrl = fromJsonValue<QString>(source["ModelUrl"]);
|
||||
m_serialNumber = fromJsonValue<QString>(source["SerialNumber"]);
|
||||
m_enableAlbumArtInDidl = fromJsonValue<bool>(source["EnableAlbumArtInDidl"]);
|
||||
m_enableSingleAlbumArtLimit = fromJsonValue<bool>(source["EnableSingleAlbumArtLimit"]);
|
||||
m_enableSingleSubtitleLimit = fromJsonValue<bool>(source["EnableSingleSubtitleLimit"]);
|
||||
m_supportedMediaTypes = fromJsonValue<QString>(source["SupportedMediaTypes"]);
|
||||
m_userId = fromJsonValue<QString>(source["UserId"]);
|
||||
m_albumArtPn = fromJsonValue<QString>(source["AlbumArtPn"]);
|
||||
m_maxAlbumArtWidth = fromJsonValue<qint32>(source["MaxAlbumArtWidth"]);
|
||||
m_maxAlbumArtHeight = fromJsonValue<qint32>(source["MaxAlbumArtHeight"]);
|
||||
m_maxIconWidth = fromJsonValue<qint32>(source["MaxIconWidth"]);
|
||||
m_maxIconHeight = fromJsonValue<qint32>(source["MaxIconHeight"]);
|
||||
m_maxStreamingBitrate = fromJsonValue<qint32>(source["MaxStreamingBitrate"]);
|
||||
m_maxStaticBitrate = fromJsonValue<qint32>(source["MaxStaticBitrate"]);
|
||||
m_musicStreamingTranscodingBitrate = fromJsonValue<qint32>(source["MusicStreamingTranscodingBitrate"]);
|
||||
m_maxStaticMusicBitrate = fromJsonValue<qint32>(source["MaxStaticMusicBitrate"]);
|
||||
m_sonyAggregationFlags = fromJsonValue<QString>(source["SonyAggregationFlags"]);
|
||||
m_protocolInfo = fromJsonValue<QString>(source["ProtocolInfo"]);
|
||||
m_timelineOffsetSeconds = fromJsonValue<qint32>(source["TimelineOffsetSeconds"]);
|
||||
m_requiresPlainVideoItems = fromJsonValue<bool>(source["RequiresPlainVideoItems"]);
|
||||
m_requiresPlainFolders = fromJsonValue<bool>(source["RequiresPlainFolders"]);
|
||||
m_enableMSMediaReceiverRegistrar = fromJsonValue<bool>(source["EnableMSMediaReceiverRegistrar"]);
|
||||
m_ignoreTranscodeByteRangeRequests = fromJsonValue<bool>(source["IgnoreTranscodeByteRangeRequests"]);
|
||||
m_xmlRootAttributes = fromJsonValue<QList<QSharedPointer<XmlAttribute>>>(source["XmlRootAttributes"]);
|
||||
m_directPlayProfiles = fromJsonValue<QList<QSharedPointer<DirectPlayProfile>>>(source["DirectPlayProfiles"]);
|
||||
m_transcodingProfiles = fromJsonValue<QList<QSharedPointer<TranscodingProfile>>>(source["TranscodingProfiles"]);
|
||||
m_containerProfiles = fromJsonValue<QList<QSharedPointer<ContainerProfile>>>(source["ContainerProfiles"]);
|
||||
m_codecProfiles = fromJsonValue<QList<QSharedPointer<CodecProfile>>>(source["CodecProfiles"]);
|
||||
m_responseProfiles = fromJsonValue<QList<QSharedPointer<ResponseProfile>>>(source["ResponseProfiles"]);
|
||||
m_subtitleProfiles = fromJsonValue<QList<QSharedPointer<SubtitleProfile>>>(source["SubtitleProfiles"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_identification = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceIdentification>>(source["Identification"]);
|
||||
m_friendlyName = Jellyfin::Support::fromJsonValue<QString>(source["FriendlyName"]);
|
||||
m_manufacturer = Jellyfin::Support::fromJsonValue<QString>(source["Manufacturer"]);
|
||||
m_manufacturerUrl = Jellyfin::Support::fromJsonValue<QString>(source["ManufacturerUrl"]);
|
||||
m_modelName = Jellyfin::Support::fromJsonValue<QString>(source["ModelName"]);
|
||||
m_modelDescription = Jellyfin::Support::fromJsonValue<QString>(source["ModelDescription"]);
|
||||
m_modelNumber = Jellyfin::Support::fromJsonValue<QString>(source["ModelNumber"]);
|
||||
m_modelUrl = Jellyfin::Support::fromJsonValue<QString>(source["ModelUrl"]);
|
||||
m_serialNumber = Jellyfin::Support::fromJsonValue<QString>(source["SerialNumber"]);
|
||||
m_enableAlbumArtInDidl = Jellyfin::Support::fromJsonValue<bool>(source["EnableAlbumArtInDidl"]);
|
||||
m_enableSingleAlbumArtLimit = Jellyfin::Support::fromJsonValue<bool>(source["EnableSingleAlbumArtLimit"]);
|
||||
m_enableSingleSubtitleLimit = Jellyfin::Support::fromJsonValue<bool>(source["EnableSingleSubtitleLimit"]);
|
||||
m_supportedMediaTypes = Jellyfin::Support::fromJsonValue<QString>(source["SupportedMediaTypes"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QString>(source["UserId"]);
|
||||
m_albumArtPn = Jellyfin::Support::fromJsonValue<QString>(source["AlbumArtPn"]);
|
||||
m_maxAlbumArtWidth = Jellyfin::Support::fromJsonValue<qint32>(source["MaxAlbumArtWidth"]);
|
||||
m_maxAlbumArtHeight = Jellyfin::Support::fromJsonValue<qint32>(source["MaxAlbumArtHeight"]);
|
||||
m_maxIconWidth = Jellyfin::Support::fromJsonValue<qint32>(source["MaxIconWidth"]);
|
||||
m_maxIconHeight = Jellyfin::Support::fromJsonValue<qint32>(source["MaxIconHeight"]);
|
||||
m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue<qint32>(source["MaxStreamingBitrate"]);
|
||||
m_maxStaticBitrate = Jellyfin::Support::fromJsonValue<qint32>(source["MaxStaticBitrate"]);
|
||||
m_musicStreamingTranscodingBitrate = Jellyfin::Support::fromJsonValue<qint32>(source["MusicStreamingTranscodingBitrate"]);
|
||||
m_maxStaticMusicBitrate = Jellyfin::Support::fromJsonValue<qint32>(source["MaxStaticMusicBitrate"]);
|
||||
m_sonyAggregationFlags = Jellyfin::Support::fromJsonValue<QString>(source["SonyAggregationFlags"]);
|
||||
m_protocolInfo = Jellyfin::Support::fromJsonValue<QString>(source["ProtocolInfo"]);
|
||||
m_timelineOffsetSeconds = Jellyfin::Support::fromJsonValue<qint32>(source["TimelineOffsetSeconds"]);
|
||||
m_requiresPlainVideoItems = Jellyfin::Support::fromJsonValue<bool>(source["RequiresPlainVideoItems"]);
|
||||
m_requiresPlainFolders = Jellyfin::Support::fromJsonValue<bool>(source["RequiresPlainFolders"]);
|
||||
m_enableMSMediaReceiverRegistrar = Jellyfin::Support::fromJsonValue<bool>(source["EnableMSMediaReceiverRegistrar"]);
|
||||
m_ignoreTranscodeByteRangeRequests = Jellyfin::Support::fromJsonValue<bool>(source["IgnoreTranscodeByteRangeRequests"]);
|
||||
m_xmlRootAttributes = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<XmlAttribute>>>(source["XmlRootAttributes"]);
|
||||
m_directPlayProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<DirectPlayProfile>>>(source["DirectPlayProfiles"]);
|
||||
m_transcodingProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<TranscodingProfile>>>(source["TranscodingProfiles"]);
|
||||
m_containerProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ContainerProfile>>>(source["ContainerProfiles"]);
|
||||
m_codecProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<CodecProfile>>>(source["CodecProfiles"]);
|
||||
m_responseProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<ResponseProfile>>>(source["ResponseProfiles"]);
|
||||
m_subtitleProfiles = Jellyfin::Support::fromJsonValue<QList<QSharedPointer<SubtitleProfile>>>(source["SubtitleProfiles"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceProfile::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["Identification"] = toJsonValue<QSharedPointer<DeviceIdentification>>(m_identification);
|
||||
result["FriendlyName"] = toJsonValue<QString>(m_friendlyName);
|
||||
result["Manufacturer"] = toJsonValue<QString>(m_manufacturer);
|
||||
result["ManufacturerUrl"] = toJsonValue<QString>(m_manufacturerUrl);
|
||||
result["ModelName"] = toJsonValue<QString>(m_modelName);
|
||||
result["ModelDescription"] = toJsonValue<QString>(m_modelDescription);
|
||||
result["ModelNumber"] = toJsonValue<QString>(m_modelNumber);
|
||||
result["ModelUrl"] = toJsonValue<QString>(m_modelUrl);
|
||||
result["SerialNumber"] = toJsonValue<QString>(m_serialNumber);
|
||||
result["EnableAlbumArtInDidl"] = toJsonValue<bool>(m_enableAlbumArtInDidl);
|
||||
result["EnableSingleAlbumArtLimit"] = toJsonValue<bool>(m_enableSingleAlbumArtLimit);
|
||||
result["EnableSingleSubtitleLimit"] = toJsonValue<bool>(m_enableSingleSubtitleLimit);
|
||||
result["SupportedMediaTypes"] = toJsonValue<QString>(m_supportedMediaTypes);
|
||||
result["UserId"] = toJsonValue<QString>(m_userId);
|
||||
result["AlbumArtPn"] = toJsonValue<QString>(m_albumArtPn);
|
||||
result["MaxAlbumArtWidth"] = toJsonValue<qint32>(m_maxAlbumArtWidth);
|
||||
result["MaxAlbumArtHeight"] = toJsonValue<qint32>(m_maxAlbumArtHeight);
|
||||
result["MaxIconWidth"] = toJsonValue<qint32>(m_maxIconWidth);
|
||||
result["MaxIconHeight"] = toJsonValue<qint32>(m_maxIconHeight);
|
||||
result["MaxStreamingBitrate"] = toJsonValue<qint32>(m_maxStreamingBitrate);
|
||||
result["MaxStaticBitrate"] = toJsonValue<qint32>(m_maxStaticBitrate);
|
||||
result["MusicStreamingTranscodingBitrate"] = toJsonValue<qint32>(m_musicStreamingTranscodingBitrate);
|
||||
result["MaxStaticMusicBitrate"] = toJsonValue<qint32>(m_maxStaticMusicBitrate);
|
||||
result["SonyAggregationFlags"] = toJsonValue<QString>(m_sonyAggregationFlags);
|
||||
result["ProtocolInfo"] = toJsonValue<QString>(m_protocolInfo);
|
||||
result["TimelineOffsetSeconds"] = toJsonValue<qint32>(m_timelineOffsetSeconds);
|
||||
result["RequiresPlainVideoItems"] = toJsonValue<bool>(m_requiresPlainVideoItems);
|
||||
result["RequiresPlainFolders"] = toJsonValue<bool>(m_requiresPlainFolders);
|
||||
result["EnableMSMediaReceiverRegistrar"] = toJsonValue<bool>(m_enableMSMediaReceiverRegistrar);
|
||||
result["IgnoreTranscodeByteRangeRequests"] = toJsonValue<bool>(m_ignoreTranscodeByteRangeRequests);
|
||||
result["XmlRootAttributes"] = toJsonValue<QList<QSharedPointer<XmlAttribute>>>(m_xmlRootAttributes);
|
||||
result["DirectPlayProfiles"] = toJsonValue<QList<QSharedPointer<DirectPlayProfile>>>(m_directPlayProfiles);
|
||||
result["TranscodingProfiles"] = toJsonValue<QList<QSharedPointer<TranscodingProfile>>>(m_transcodingProfiles);
|
||||
result["ContainerProfiles"] = toJsonValue<QList<QSharedPointer<ContainerProfile>>>(m_containerProfiles);
|
||||
result["CodecProfiles"] = toJsonValue<QList<QSharedPointer<CodecProfile>>>(m_codecProfiles);
|
||||
result["ResponseProfiles"] = toJsonValue<QList<QSharedPointer<ResponseProfile>>>(m_responseProfiles);
|
||||
result["SubtitleProfiles"] = toJsonValue<QList<QSharedPointer<SubtitleProfile>>>(m_subtitleProfiles);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["Identification"] = Jellyfin::Support::toJsonValue<QSharedPointer<DeviceIdentification>>(m_identification);
|
||||
result["FriendlyName"] = Jellyfin::Support::toJsonValue<QString>(m_friendlyName);
|
||||
result["Manufacturer"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturer);
|
||||
result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturerUrl);
|
||||
result["ModelName"] = Jellyfin::Support::toJsonValue<QString>(m_modelName);
|
||||
result["ModelDescription"] = Jellyfin::Support::toJsonValue<QString>(m_modelDescription);
|
||||
result["ModelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_modelNumber);
|
||||
result["ModelUrl"] = Jellyfin::Support::toJsonValue<QString>(m_modelUrl);
|
||||
result["SerialNumber"] = Jellyfin::Support::toJsonValue<QString>(m_serialNumber);
|
||||
result["EnableAlbumArtInDidl"] = Jellyfin::Support::toJsonValue<bool>(m_enableAlbumArtInDidl);
|
||||
result["EnableSingleAlbumArtLimit"] = Jellyfin::Support::toJsonValue<bool>(m_enableSingleAlbumArtLimit);
|
||||
result["EnableSingleSubtitleLimit"] = Jellyfin::Support::toJsonValue<bool>(m_enableSingleSubtitleLimit);
|
||||
result["SupportedMediaTypes"] = Jellyfin::Support::toJsonValue<QString>(m_supportedMediaTypes);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
|
||||
result["AlbumArtPn"] = Jellyfin::Support::toJsonValue<QString>(m_albumArtPn);
|
||||
result["MaxAlbumArtWidth"] = Jellyfin::Support::toJsonValue<qint32>(m_maxAlbumArtWidth);
|
||||
result["MaxAlbumArtHeight"] = Jellyfin::Support::toJsonValue<qint32>(m_maxAlbumArtHeight);
|
||||
result["MaxIconWidth"] = Jellyfin::Support::toJsonValue<qint32>(m_maxIconWidth);
|
||||
result["MaxIconHeight"] = Jellyfin::Support::toJsonValue<qint32>(m_maxIconHeight);
|
||||
result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue<qint32>(m_maxStreamingBitrate);
|
||||
result["MaxStaticBitrate"] = Jellyfin::Support::toJsonValue<qint32>(m_maxStaticBitrate);
|
||||
result["MusicStreamingTranscodingBitrate"] = Jellyfin::Support::toJsonValue<qint32>(m_musicStreamingTranscodingBitrate);
|
||||
result["MaxStaticMusicBitrate"] = Jellyfin::Support::toJsonValue<qint32>(m_maxStaticMusicBitrate);
|
||||
result["SonyAggregationFlags"] = Jellyfin::Support::toJsonValue<QString>(m_sonyAggregationFlags);
|
||||
result["ProtocolInfo"] = Jellyfin::Support::toJsonValue<QString>(m_protocolInfo);
|
||||
result["TimelineOffsetSeconds"] = Jellyfin::Support::toJsonValue<qint32>(m_timelineOffsetSeconds);
|
||||
result["RequiresPlainVideoItems"] = Jellyfin::Support::toJsonValue<bool>(m_requiresPlainVideoItems);
|
||||
result["RequiresPlainFolders"] = Jellyfin::Support::toJsonValue<bool>(m_requiresPlainFolders);
|
||||
result["EnableMSMediaReceiverRegistrar"] = Jellyfin::Support::toJsonValue<bool>(m_enableMSMediaReceiverRegistrar);
|
||||
result["IgnoreTranscodeByteRangeRequests"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreTranscodeByteRangeRequests);
|
||||
result["XmlRootAttributes"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<XmlAttribute>>>(m_xmlRootAttributes);
|
||||
result["DirectPlayProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<DirectPlayProfile>>>(m_directPlayProfiles);
|
||||
result["TranscodingProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<TranscodingProfile>>>(m_transcodingProfiles);
|
||||
result["ContainerProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ContainerProfile>>>(m_containerProfiles);
|
||||
result["CodecProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<CodecProfile>>>(m_codecProfiles);
|
||||
result["ResponseProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<ResponseProfile>>>(m_responseProfiles);
|
||||
result["SubtitleProfiles"] = Jellyfin::Support::toJsonValue<QList<QSharedPointer<SubtitleProfile>>>(m_subtitleProfiles);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -324,6 +325,17 @@ void DeviceProfile::setSubtitleProfiles(QList<QSharedPointer<SubtitleProfile>> n
|
|||
m_subtitleProfiles = newSubtitleProfiles;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceProfile = Jellyfin::DTO::DeviceProfile;
|
||||
|
||||
template <>
|
||||
DeviceProfile fromJsonValue<DeviceProfile>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceProfile::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DeviceProfileInfo::DeviceProfileInfo(QObject *parent) {}
|
||||
DeviceProfileInfo::DeviceProfileInfo() {}
|
||||
|
||||
DeviceProfileInfo DeviceProfileInfo::fromJson(QJsonObject source) {DeviceProfileInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
DeviceProfileInfo DeviceProfileInfo::fromJson(QJsonObject source) {
|
||||
DeviceProfileInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DeviceProfileInfo::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_type = fromJsonValue<DeviceProfileType>(source["Type"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<DeviceProfileType>(source["Type"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DeviceProfileInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Type"] = toJsonValue<DeviceProfileType>(m_type);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<DeviceProfileType>(m_type);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void DeviceProfileInfo::setType(DeviceProfileType newType) {
|
|||
m_type = newType;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo;
|
||||
|
||||
template <>
|
||||
DeviceProfileInfo fromJsonValue<DeviceProfileInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DeviceProfileInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
DeviceProfileTypeClass::DeviceProfileTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DeviceProfileType = Jellyfin::DTO::DeviceProfileType;
|
||||
|
||||
template <>
|
||||
DeviceProfileType fromJsonValue<DeviceProfileType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return DeviceProfileType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("System")) {
|
||||
return DeviceProfileType::System;
|
||||
}
|
||||
if (str == QStringLiteral("User")) {
|
||||
return DeviceProfileType::User;
|
||||
}
|
||||
|
||||
return DeviceProfileType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DirectPlayProfile::DirectPlayProfile(QObject *parent) {}
|
||||
DirectPlayProfile::DirectPlayProfile() {}
|
||||
|
||||
DirectPlayProfile DirectPlayProfile::fromJson(QJsonObject source) {DirectPlayProfile instance;
|
||||
instance->setFromJson(source, false);
|
||||
DirectPlayProfile DirectPlayProfile::fromJson(QJsonObject source) {
|
||||
DirectPlayProfile instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DirectPlayProfile::setFromJson(QJsonObject source) {
|
||||
m_container = fromJsonValue<QString>(source["Container"]);
|
||||
m_audioCodec = fromJsonValue<QString>(source["AudioCodec"]);
|
||||
m_videoCodec = fromJsonValue<QString>(source["VideoCodec"]);
|
||||
m_type = fromJsonValue<DlnaProfileType>(source["Type"]);
|
||||
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
|
||||
m_audioCodec = Jellyfin::Support::fromJsonValue<QString>(source["AudioCodec"]);
|
||||
m_videoCodec = Jellyfin::Support::fromJsonValue<QString>(source["VideoCodec"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<DlnaProfileType>(source["Type"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DirectPlayProfile::toJson() {
|
||||
QJsonObject result;
|
||||
result["Container"] = toJsonValue<QString>(m_container);
|
||||
result["AudioCodec"] = toJsonValue<QString>(m_audioCodec);
|
||||
result["VideoCodec"] = toJsonValue<QString>(m_videoCodec);
|
||||
result["Type"] = toJsonValue<DlnaProfileType>(m_type);
|
||||
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
|
||||
result["AudioCodec"] = Jellyfin::Support::toJsonValue<QString>(m_audioCodec);
|
||||
result["VideoCodec"] = Jellyfin::Support::toJsonValue<QString>(m_videoCodec);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<DlnaProfileType>(m_type);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void DirectPlayProfile::setType(DlnaProfileType newType) {
|
|||
m_type = newType;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DirectPlayProfile = Jellyfin::DTO::DirectPlayProfile;
|
||||
|
||||
template <>
|
||||
DirectPlayProfile fromJsonValue<DirectPlayProfile>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DirectPlayProfile::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,48 +32,49 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
DisplayPreferencesDto::DisplayPreferencesDto(QObject *parent) {}
|
||||
DisplayPreferencesDto::DisplayPreferencesDto() {}
|
||||
|
||||
DisplayPreferencesDto DisplayPreferencesDto::fromJson(QJsonObject source) {DisplayPreferencesDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
DisplayPreferencesDto DisplayPreferencesDto::fromJson(QJsonObject source) {
|
||||
DisplayPreferencesDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void DisplayPreferencesDto::setFromJson(QJsonObject source) {
|
||||
m_jellyfinId = fromJsonValue<QString>(source["Id"]);
|
||||
m_viewType = fromJsonValue<QString>(source["ViewType"]);
|
||||
m_sortBy = fromJsonValue<QString>(source["SortBy"]);
|
||||
m_indexBy = fromJsonValue<QString>(source["IndexBy"]);
|
||||
m_rememberIndexing = fromJsonValue<bool>(source["RememberIndexing"]);
|
||||
m_primaryImageHeight = fromJsonValue<qint32>(source["PrimaryImageHeight"]);
|
||||
m_primaryImageWidth = fromJsonValue<qint32>(source["PrimaryImageWidth"]);
|
||||
m_customPrefs = fromJsonValue<QJsonObject>(source["CustomPrefs"]);
|
||||
m_scrollDirection = fromJsonValue<ScrollDirection>(source["ScrollDirection"]);
|
||||
m_showBackdrop = fromJsonValue<bool>(source["ShowBackdrop"]);
|
||||
m_rememberSorting = fromJsonValue<bool>(source["RememberSorting"]);
|
||||
m_sortOrder = fromJsonValue<SortOrder>(source["SortOrder"]);
|
||||
m_showSidebar = fromJsonValue<bool>(source["ShowSidebar"]);
|
||||
m_client = fromJsonValue<QString>(source["Client"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
|
||||
m_viewType = Jellyfin::Support::fromJsonValue<QString>(source["ViewType"]);
|
||||
m_sortBy = Jellyfin::Support::fromJsonValue<QString>(source["SortBy"]);
|
||||
m_indexBy = Jellyfin::Support::fromJsonValue<QString>(source["IndexBy"]);
|
||||
m_rememberIndexing = Jellyfin::Support::fromJsonValue<bool>(source["RememberIndexing"]);
|
||||
m_primaryImageHeight = Jellyfin::Support::fromJsonValue<qint32>(source["PrimaryImageHeight"]);
|
||||
m_primaryImageWidth = Jellyfin::Support::fromJsonValue<qint32>(source["PrimaryImageWidth"]);
|
||||
m_customPrefs = Jellyfin::Support::fromJsonValue<QJsonObject>(source["CustomPrefs"]);
|
||||
m_scrollDirection = Jellyfin::Support::fromJsonValue<ScrollDirection>(source["ScrollDirection"]);
|
||||
m_showBackdrop = Jellyfin::Support::fromJsonValue<bool>(source["ShowBackdrop"]);
|
||||
m_rememberSorting = Jellyfin::Support::fromJsonValue<bool>(source["RememberSorting"]);
|
||||
m_sortOrder = Jellyfin::Support::fromJsonValue<SortOrder>(source["SortOrder"]);
|
||||
m_showSidebar = Jellyfin::Support::fromJsonValue<bool>(source["ShowSidebar"]);
|
||||
m_client = Jellyfin::Support::fromJsonValue<QString>(source["Client"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject DisplayPreferencesDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["Id"] = toJsonValue<QString>(m_jellyfinId);
|
||||
result["ViewType"] = toJsonValue<QString>(m_viewType);
|
||||
result["SortBy"] = toJsonValue<QString>(m_sortBy);
|
||||
result["IndexBy"] = toJsonValue<QString>(m_indexBy);
|
||||
result["RememberIndexing"] = toJsonValue<bool>(m_rememberIndexing);
|
||||
result["PrimaryImageHeight"] = toJsonValue<qint32>(m_primaryImageHeight);
|
||||
result["PrimaryImageWidth"] = toJsonValue<qint32>(m_primaryImageWidth);
|
||||
result["CustomPrefs"] = toJsonValue<QJsonObject>(m_customPrefs);
|
||||
result["ScrollDirection"] = toJsonValue<ScrollDirection>(m_scrollDirection);
|
||||
result["ShowBackdrop"] = toJsonValue<bool>(m_showBackdrop);
|
||||
result["RememberSorting"] = toJsonValue<bool>(m_rememberSorting);
|
||||
result["SortOrder"] = toJsonValue<SortOrder>(m_sortOrder);
|
||||
result["ShowSidebar"] = toJsonValue<bool>(m_showSidebar);
|
||||
result["Client"] = toJsonValue<QString>(m_client);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
|
||||
result["ViewType"] = Jellyfin::Support::toJsonValue<QString>(m_viewType);
|
||||
result["SortBy"] = Jellyfin::Support::toJsonValue<QString>(m_sortBy);
|
||||
result["IndexBy"] = Jellyfin::Support::toJsonValue<QString>(m_indexBy);
|
||||
result["RememberIndexing"] = Jellyfin::Support::toJsonValue<bool>(m_rememberIndexing);
|
||||
result["PrimaryImageHeight"] = Jellyfin::Support::toJsonValue<qint32>(m_primaryImageHeight);
|
||||
result["PrimaryImageWidth"] = Jellyfin::Support::toJsonValue<qint32>(m_primaryImageWidth);
|
||||
result["CustomPrefs"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_customPrefs);
|
||||
result["ScrollDirection"] = Jellyfin::Support::toJsonValue<ScrollDirection>(m_scrollDirection);
|
||||
result["ShowBackdrop"] = Jellyfin::Support::toJsonValue<bool>(m_showBackdrop);
|
||||
result["RememberSorting"] = Jellyfin::Support::toJsonValue<bool>(m_rememberSorting);
|
||||
result["SortOrder"] = Jellyfin::Support::toJsonValue<SortOrder>(m_sortOrder);
|
||||
result["ShowSidebar"] = Jellyfin::Support::toJsonValue<bool>(m_showSidebar);
|
||||
result["Client"] = Jellyfin::Support::toJsonValue<QString>(m_client);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -149,6 +150,17 @@ void DisplayPreferencesDto::setClient(QString newClient) {
|
|||
m_client = newClient;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DisplayPreferencesDto = Jellyfin::DTO::DisplayPreferencesDto;
|
||||
|
||||
template <>
|
||||
DisplayPreferencesDto fromJsonValue<DisplayPreferencesDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return DisplayPreferencesDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
DlnaProfileTypeClass::DlnaProfileTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DlnaProfileType = Jellyfin::DTO::DlnaProfileType;
|
||||
|
||||
template <>
|
||||
DlnaProfileType fromJsonValue<DlnaProfileType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return DlnaProfileType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Audio")) {
|
||||
return DlnaProfileType::Audio;
|
||||
}
|
||||
if (str == QStringLiteral("Video")) {
|
||||
return DlnaProfileType::Video;
|
||||
}
|
||||
if (str == QStringLiteral("Photo")) {
|
||||
return DlnaProfileType::Photo;
|
||||
}
|
||||
|
||||
return DlnaProfileType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,51 @@ namespace DTO {
|
|||
|
||||
DynamicDayOfWeekClass::DynamicDayOfWeekClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using DynamicDayOfWeek = Jellyfin::DTO::DynamicDayOfWeek;
|
||||
|
||||
template <>
|
||||
DynamicDayOfWeek fromJsonValue<DynamicDayOfWeek>(const QJsonValue &source) {
|
||||
if (!source.isString()) return DynamicDayOfWeek::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Sunday")) {
|
||||
return DynamicDayOfWeek::Sunday;
|
||||
}
|
||||
if (str == QStringLiteral("Monday")) {
|
||||
return DynamicDayOfWeek::Monday;
|
||||
}
|
||||
if (str == QStringLiteral("Tuesday")) {
|
||||
return DynamicDayOfWeek::Tuesday;
|
||||
}
|
||||
if (str == QStringLiteral("Wednesday")) {
|
||||
return DynamicDayOfWeek::Wednesday;
|
||||
}
|
||||
if (str == QStringLiteral("Thursday")) {
|
||||
return DynamicDayOfWeek::Thursday;
|
||||
}
|
||||
if (str == QStringLiteral("Friday")) {
|
||||
return DynamicDayOfWeek::Friday;
|
||||
}
|
||||
if (str == QStringLiteral("Saturday")) {
|
||||
return DynamicDayOfWeek::Saturday;
|
||||
}
|
||||
if (str == QStringLiteral("Everyday")) {
|
||||
return DynamicDayOfWeek::Everyday;
|
||||
}
|
||||
if (str == QStringLiteral("Weekday")) {
|
||||
return DynamicDayOfWeek::Weekday;
|
||||
}
|
||||
if (str == QStringLiteral("Weekend")) {
|
||||
return DynamicDayOfWeek::Weekend;
|
||||
}
|
||||
|
||||
return DynamicDayOfWeek::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
EncodingContextClass::EncodingContextClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using EncodingContext = Jellyfin::DTO::EncodingContext;
|
||||
|
||||
template <>
|
||||
EncodingContext fromJsonValue<EncodingContext>(const QJsonValue &source) {
|
||||
if (!source.isString()) return EncodingContext::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Streaming")) {
|
||||
return EncodingContext::Streaming;
|
||||
}
|
||||
if (str == QStringLiteral("Static")) {
|
||||
return EncodingContext::Static;
|
||||
}
|
||||
|
||||
return EncodingContext::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
EndPointInfo::EndPointInfo(QObject *parent) {}
|
||||
EndPointInfo::EndPointInfo() {}
|
||||
|
||||
EndPointInfo EndPointInfo::fromJson(QJsonObject source) {EndPointInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
EndPointInfo EndPointInfo::fromJson(QJsonObject source) {
|
||||
EndPointInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void EndPointInfo::setFromJson(QJsonObject source) {
|
||||
m_isLocal = fromJsonValue<bool>(source["IsLocal"]);
|
||||
m_isInNetwork = fromJsonValue<bool>(source["IsInNetwork"]);
|
||||
m_isLocal = Jellyfin::Support::fromJsonValue<bool>(source["IsLocal"]);
|
||||
m_isInNetwork = Jellyfin::Support::fromJsonValue<bool>(source["IsInNetwork"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject EndPointInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["IsLocal"] = toJsonValue<bool>(m_isLocal);
|
||||
result["IsInNetwork"] = toJsonValue<bool>(m_isInNetwork);
|
||||
result["IsLocal"] = Jellyfin::Support::toJsonValue<bool>(m_isLocal);
|
||||
result["IsInNetwork"] = Jellyfin::Support::toJsonValue<bool>(m_isInNetwork);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void EndPointInfo::setIsInNetwork(bool newIsInNetwork) {
|
|||
m_isInNetwork = newIsInNetwork;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using EndPointInfo = Jellyfin::DTO::EndPointInfo;
|
||||
|
||||
template <>
|
||||
EndPointInfo fromJsonValue<EndPointInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return EndPointInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ExternalIdInfo::ExternalIdInfo(QObject *parent) {}
|
||||
ExternalIdInfo::ExternalIdInfo() {}
|
||||
|
||||
ExternalIdInfo ExternalIdInfo::fromJson(QJsonObject source) {ExternalIdInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ExternalIdInfo ExternalIdInfo::fromJson(QJsonObject source) {
|
||||
ExternalIdInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ExternalIdInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_key = fromJsonValue<QString>(source["Key"]);
|
||||
m_type = fromJsonValue<ExternalIdMediaType>(source["Type"]);
|
||||
m_urlFormatString = fromJsonValue<QString>(source["UrlFormatString"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_key = Jellyfin::Support::fromJsonValue<QString>(source["Key"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<ExternalIdMediaType>(source["Type"]);
|
||||
m_urlFormatString = Jellyfin::Support::fromJsonValue<QString>(source["UrlFormatString"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ExternalIdInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Key"] = toJsonValue<QString>(m_key);
|
||||
result["Type"] = toJsonValue<ExternalIdMediaType>(m_type);
|
||||
result["UrlFormatString"] = toJsonValue<QString>(m_urlFormatString);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Key"] = Jellyfin::Support::toJsonValue<QString>(m_key);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<ExternalIdMediaType>(m_type);
|
||||
result["UrlFormatString"] = Jellyfin::Support::toJsonValue<QString>(m_urlFormatString);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void ExternalIdInfo::setUrlFormatString(QString newUrlFormatString) {
|
|||
m_urlFormatString = newUrlFormatString;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ExternalIdInfo = Jellyfin::DTO::ExternalIdInfo;
|
||||
|
||||
template <>
|
||||
ExternalIdInfo fromJsonValue<ExternalIdInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ExternalIdInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,57 @@ namespace DTO {
|
|||
|
||||
ExternalIdMediaTypeClass::ExternalIdMediaTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ExternalIdMediaType = Jellyfin::DTO::ExternalIdMediaType;
|
||||
|
||||
template <>
|
||||
ExternalIdMediaType fromJsonValue<ExternalIdMediaType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ExternalIdMediaType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Album")) {
|
||||
return ExternalIdMediaType::Album;
|
||||
}
|
||||
if (str == QStringLiteral("AlbumArtist")) {
|
||||
return ExternalIdMediaType::AlbumArtist;
|
||||
}
|
||||
if (str == QStringLiteral("Artist")) {
|
||||
return ExternalIdMediaType::Artist;
|
||||
}
|
||||
if (str == QStringLiteral("BoxSet")) {
|
||||
return ExternalIdMediaType::BoxSet;
|
||||
}
|
||||
if (str == QStringLiteral("Episode")) {
|
||||
return ExternalIdMediaType::Episode;
|
||||
}
|
||||
if (str == QStringLiteral("Movie")) {
|
||||
return ExternalIdMediaType::Movie;
|
||||
}
|
||||
if (str == QStringLiteral("OtherArtist")) {
|
||||
return ExternalIdMediaType::OtherArtist;
|
||||
}
|
||||
if (str == QStringLiteral("Person")) {
|
||||
return ExternalIdMediaType::Person;
|
||||
}
|
||||
if (str == QStringLiteral("ReleaseGroup")) {
|
||||
return ExternalIdMediaType::ReleaseGroup;
|
||||
}
|
||||
if (str == QStringLiteral("Season")) {
|
||||
return ExternalIdMediaType::Season;
|
||||
}
|
||||
if (str == QStringLiteral("Series")) {
|
||||
return ExternalIdMediaType::Series;
|
||||
}
|
||||
if (str == QStringLiteral("Track")) {
|
||||
return ExternalIdMediaType::Track;
|
||||
}
|
||||
|
||||
return ExternalIdMediaType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ExternalUrl::ExternalUrl(QObject *parent) {}
|
||||
ExternalUrl::ExternalUrl() {}
|
||||
|
||||
ExternalUrl ExternalUrl::fromJson(QJsonObject source) {ExternalUrl instance;
|
||||
instance->setFromJson(source, false);
|
||||
ExternalUrl ExternalUrl::fromJson(QJsonObject source) {
|
||||
ExternalUrl instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ExternalUrl::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_url = fromJsonValue<QString>(source["Url"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_url = Jellyfin::Support::fromJsonValue<QString>(source["Url"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ExternalUrl::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Url"] = toJsonValue<QString>(m_url);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Url"] = Jellyfin::Support::toJsonValue<QString>(m_url);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void ExternalUrl::setUrl(QString newUrl) {
|
|||
m_url = newUrl;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ExternalUrl = Jellyfin::DTO::ExternalUrl;
|
||||
|
||||
template <>
|
||||
ExternalUrl fromJsonValue<ExternalUrl>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ExternalUrl::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,33 @@ namespace DTO {
|
|||
|
||||
FFmpegLocationClass::FFmpegLocationClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using FFmpegLocation = Jellyfin::DTO::FFmpegLocation;
|
||||
|
||||
template <>
|
||||
FFmpegLocation fromJsonValue<FFmpegLocation>(const QJsonValue &source) {
|
||||
if (!source.isString()) return FFmpegLocation::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("NotFound")) {
|
||||
return FFmpegLocation::NotFound;
|
||||
}
|
||||
if (str == QStringLiteral("SetByArgument")) {
|
||||
return FFmpegLocation::SetByArgument;
|
||||
}
|
||||
if (str == QStringLiteral("Custom")) {
|
||||
return FFmpegLocation::Custom;
|
||||
}
|
||||
if (str == QStringLiteral("System")) {
|
||||
return FFmpegLocation::System;
|
||||
}
|
||||
|
||||
return FFmpegLocation::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
FileSystemEntryInfo::FileSystemEntryInfo(QObject *parent) {}
|
||||
FileSystemEntryInfo::FileSystemEntryInfo() {}
|
||||
|
||||
FileSystemEntryInfo FileSystemEntryInfo::fromJson(QJsonObject source) {FileSystemEntryInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
FileSystemEntryInfo FileSystemEntryInfo::fromJson(QJsonObject source) {
|
||||
FileSystemEntryInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void FileSystemEntryInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_type = fromJsonValue<FileSystemEntryType>(source["Type"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<FileSystemEntryType>(source["Type"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject FileSystemEntryInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["Type"] = toJsonValue<FileSystemEntryType>(m_type);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<FileSystemEntryType>(m_type);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void FileSystemEntryInfo::setType(FileSystemEntryType newType) {
|
|||
m_type = newType;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using FileSystemEntryInfo = Jellyfin::DTO::FileSystemEntryInfo;
|
||||
|
||||
template <>
|
||||
FileSystemEntryInfo fromJsonValue<FileSystemEntryInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return FileSystemEntryInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,33 @@ namespace DTO {
|
|||
|
||||
FileSystemEntryTypeClass::FileSystemEntryTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using FileSystemEntryType = Jellyfin::DTO::FileSystemEntryType;
|
||||
|
||||
template <>
|
||||
FileSystemEntryType fromJsonValue<FileSystemEntryType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return FileSystemEntryType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("File")) {
|
||||
return FileSystemEntryType::File;
|
||||
}
|
||||
if (str == QStringLiteral("Directory")) {
|
||||
return FileSystemEntryType::Directory;
|
||||
}
|
||||
if (str == QStringLiteral("NetworkComputer")) {
|
||||
return FileSystemEntryType::NetworkComputer;
|
||||
}
|
||||
if (str == QStringLiteral("NetworkShare")) {
|
||||
return FileSystemEntryType::NetworkShare;
|
||||
}
|
||||
|
||||
return FileSystemEntryType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
FontFile::FontFile(QObject *parent) {}
|
||||
FontFile::FontFile() {}
|
||||
|
||||
FontFile FontFile::fromJson(QJsonObject source) {FontFile instance;
|
||||
instance->setFromJson(source, false);
|
||||
FontFile FontFile::fromJson(QJsonObject source) {
|
||||
FontFile instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void FontFile::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_size = fromJsonValue<qint64>(source["Size"]);
|
||||
m_dateCreated = fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateModified = fromJsonValue<QDateTime>(source["DateModified"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_size = Jellyfin::Support::fromJsonValue<qint64>(source["Size"]);
|
||||
m_dateCreated = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateCreated"]);
|
||||
m_dateModified = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateModified"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject FontFile::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Size"] = toJsonValue<qint64>(m_size);
|
||||
result["DateCreated"] = toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateModified"] = toJsonValue<QDateTime>(m_dateModified);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
|
||||
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
|
||||
result["DateModified"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateModified);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void FontFile::setDateModified(QDateTime newDateModified) {
|
|||
m_dateModified = newDateModified;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using FontFile = Jellyfin::DTO::FontFile;
|
||||
|
||||
template <>
|
||||
FontFile fromJsonValue<FontFile>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return FontFile::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
ForgotPasswordActionClass::ForgotPasswordActionClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ForgotPasswordAction = Jellyfin::DTO::ForgotPasswordAction;
|
||||
|
||||
template <>
|
||||
ForgotPasswordAction fromJsonValue<ForgotPasswordAction>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ForgotPasswordAction::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("ContactAdmin")) {
|
||||
return ForgotPasswordAction::ContactAdmin;
|
||||
}
|
||||
if (str == QStringLiteral("PinCode")) {
|
||||
return ForgotPasswordAction::PinCode;
|
||||
}
|
||||
if (str == QStringLiteral("InNetworkRequired")) {
|
||||
return ForgotPasswordAction::InNetworkRequired;
|
||||
}
|
||||
|
||||
return ForgotPasswordAction::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ForgotPasswordDto::ForgotPasswordDto(QObject *parent) {}
|
||||
ForgotPasswordDto::ForgotPasswordDto() {}
|
||||
|
||||
ForgotPasswordDto ForgotPasswordDto::fromJson(QJsonObject source) {ForgotPasswordDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
ForgotPasswordDto ForgotPasswordDto::fromJson(QJsonObject source) {
|
||||
ForgotPasswordDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ForgotPasswordDto::setFromJson(QJsonObject source) {
|
||||
m_enteredUsername = fromJsonValue<QString>(source["EnteredUsername"]);
|
||||
m_enteredUsername = Jellyfin::Support::fromJsonValue<QString>(source["EnteredUsername"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ForgotPasswordDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["EnteredUsername"] = toJsonValue<QString>(m_enteredUsername);
|
||||
result["EnteredUsername"] = Jellyfin::Support::toJsonValue<QString>(m_enteredUsername);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void ForgotPasswordDto::setEnteredUsername(QString newEnteredUsername) {
|
|||
m_enteredUsername = newEnteredUsername;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ForgotPasswordDto = Jellyfin::DTO::ForgotPasswordDto;
|
||||
|
||||
template <>
|
||||
ForgotPasswordDto fromJsonValue<ForgotPasswordDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ForgotPasswordDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ForgotPasswordResult::ForgotPasswordResult(QObject *parent) {}
|
||||
ForgotPasswordResult::ForgotPasswordResult() {}
|
||||
|
||||
ForgotPasswordResult ForgotPasswordResult::fromJson(QJsonObject source) {ForgotPasswordResult instance;
|
||||
instance->setFromJson(source, false);
|
||||
ForgotPasswordResult ForgotPasswordResult::fromJson(QJsonObject source) {
|
||||
ForgotPasswordResult instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ForgotPasswordResult::setFromJson(QJsonObject source) {
|
||||
m_action = fromJsonValue<ForgotPasswordAction>(source["Action"]);
|
||||
m_pinFile = fromJsonValue<QString>(source["PinFile"]);
|
||||
m_pinExpirationDate = fromJsonValue<QDateTime>(source["PinExpirationDate"]);
|
||||
m_action = Jellyfin::Support::fromJsonValue<ForgotPasswordAction>(source["Action"]);
|
||||
m_pinFile = Jellyfin::Support::fromJsonValue<QString>(source["PinFile"]);
|
||||
m_pinExpirationDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["PinExpirationDate"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ForgotPasswordResult::toJson() {
|
||||
QJsonObject result;
|
||||
result["Action"] = toJsonValue<ForgotPasswordAction>(m_action);
|
||||
result["PinFile"] = toJsonValue<QString>(m_pinFile);
|
||||
result["PinExpirationDate"] = toJsonValue<QDateTime>(m_pinExpirationDate);
|
||||
result["Action"] = Jellyfin::Support::toJsonValue<ForgotPasswordAction>(m_action);
|
||||
result["PinFile"] = Jellyfin::Support::toJsonValue<QString>(m_pinFile);
|
||||
result["PinExpirationDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_pinExpirationDate);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void ForgotPasswordResult::setPinExpirationDate(QDateTime newPinExpirationDate)
|
|||
m_pinExpirationDate = newPinExpirationDate;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ForgotPasswordResult = Jellyfin::DTO::ForgotPasswordResult;
|
||||
|
||||
template <>
|
||||
ForgotPasswordResult fromJsonValue<ForgotPasswordResult>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ForgotPasswordResult::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
GeneralCommand::GeneralCommand(QObject *parent) {}
|
||||
GeneralCommand::GeneralCommand() {}
|
||||
|
||||
GeneralCommand GeneralCommand::fromJson(QJsonObject source) {GeneralCommand instance;
|
||||
instance->setFromJson(source, false);
|
||||
GeneralCommand GeneralCommand::fromJson(QJsonObject source) {
|
||||
GeneralCommand instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void GeneralCommand::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<GeneralCommandType>(source["Name"]);
|
||||
m_controllingUserId = fromJsonValue<QUuid>(source["ControllingUserId"]);
|
||||
m_arguments = fromJsonValue<QJsonObject>(source["Arguments"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<GeneralCommandType>(source["Name"]);
|
||||
m_controllingUserId = Jellyfin::Support::fromJsonValue<QUuid>(source["ControllingUserId"]);
|
||||
m_arguments = Jellyfin::Support::fromJsonValue<QJsonObject>(source["Arguments"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject GeneralCommand::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<GeneralCommandType>(m_name);
|
||||
result["ControllingUserId"] = toJsonValue<QUuid>(m_controllingUserId);
|
||||
result["Arguments"] = toJsonValue<QJsonObject>(m_arguments);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<GeneralCommandType>(m_name);
|
||||
result["ControllingUserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_controllingUserId);
|
||||
result["Arguments"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void GeneralCommand::setArguments(QJsonObject newArguments) {
|
|||
m_arguments = newArguments;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GeneralCommand = Jellyfin::DTO::GeneralCommand;
|
||||
|
||||
template <>
|
||||
GeneralCommand fromJsonValue<GeneralCommand>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return GeneralCommand::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,144 @@ namespace DTO {
|
|||
|
||||
GeneralCommandTypeClass::GeneralCommandTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GeneralCommandType = Jellyfin::DTO::GeneralCommandType;
|
||||
|
||||
template <>
|
||||
GeneralCommandType fromJsonValue<GeneralCommandType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GeneralCommandType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("MoveUp")) {
|
||||
return GeneralCommandType::MoveUp;
|
||||
}
|
||||
if (str == QStringLiteral("MoveDown")) {
|
||||
return GeneralCommandType::MoveDown;
|
||||
}
|
||||
if (str == QStringLiteral("MoveLeft")) {
|
||||
return GeneralCommandType::MoveLeft;
|
||||
}
|
||||
if (str == QStringLiteral("MoveRight")) {
|
||||
return GeneralCommandType::MoveRight;
|
||||
}
|
||||
if (str == QStringLiteral("PageUp")) {
|
||||
return GeneralCommandType::PageUp;
|
||||
}
|
||||
if (str == QStringLiteral("PageDown")) {
|
||||
return GeneralCommandType::PageDown;
|
||||
}
|
||||
if (str == QStringLiteral("PreviousLetter")) {
|
||||
return GeneralCommandType::PreviousLetter;
|
||||
}
|
||||
if (str == QStringLiteral("NextLetter")) {
|
||||
return GeneralCommandType::NextLetter;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleOsd")) {
|
||||
return GeneralCommandType::ToggleOsd;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleContextMenu")) {
|
||||
return GeneralCommandType::ToggleContextMenu;
|
||||
}
|
||||
if (str == QStringLiteral("Select")) {
|
||||
return GeneralCommandType::Select;
|
||||
}
|
||||
if (str == QStringLiteral("Back")) {
|
||||
return GeneralCommandType::Back;
|
||||
}
|
||||
if (str == QStringLiteral("TakeScreenshot")) {
|
||||
return GeneralCommandType::TakeScreenshot;
|
||||
}
|
||||
if (str == QStringLiteral("SendKey")) {
|
||||
return GeneralCommandType::SendKey;
|
||||
}
|
||||
if (str == QStringLiteral("SendString")) {
|
||||
return GeneralCommandType::SendString;
|
||||
}
|
||||
if (str == QStringLiteral("GoHome")) {
|
||||
return GeneralCommandType::GoHome;
|
||||
}
|
||||
if (str == QStringLiteral("GoToSettings")) {
|
||||
return GeneralCommandType::GoToSettings;
|
||||
}
|
||||
if (str == QStringLiteral("VolumeUp")) {
|
||||
return GeneralCommandType::VolumeUp;
|
||||
}
|
||||
if (str == QStringLiteral("VolumeDown")) {
|
||||
return GeneralCommandType::VolumeDown;
|
||||
}
|
||||
if (str == QStringLiteral("Mute")) {
|
||||
return GeneralCommandType::Mute;
|
||||
}
|
||||
if (str == QStringLiteral("Unmute")) {
|
||||
return GeneralCommandType::Unmute;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleMute")) {
|
||||
return GeneralCommandType::ToggleMute;
|
||||
}
|
||||
if (str == QStringLiteral("SetVolume")) {
|
||||
return GeneralCommandType::SetVolume;
|
||||
}
|
||||
if (str == QStringLiteral("SetAudioStreamIndex")) {
|
||||
return GeneralCommandType::SetAudioStreamIndex;
|
||||
}
|
||||
if (str == QStringLiteral("SetSubtitleStreamIndex")) {
|
||||
return GeneralCommandType::SetSubtitleStreamIndex;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleFullscreen")) {
|
||||
return GeneralCommandType::ToggleFullscreen;
|
||||
}
|
||||
if (str == QStringLiteral("DisplayContent")) {
|
||||
return GeneralCommandType::DisplayContent;
|
||||
}
|
||||
if (str == QStringLiteral("GoToSearch")) {
|
||||
return GeneralCommandType::GoToSearch;
|
||||
}
|
||||
if (str == QStringLiteral("DisplayMessage")) {
|
||||
return GeneralCommandType::DisplayMessage;
|
||||
}
|
||||
if (str == QStringLiteral("SetRepeatMode")) {
|
||||
return GeneralCommandType::SetRepeatMode;
|
||||
}
|
||||
if (str == QStringLiteral("ChannelUp")) {
|
||||
return GeneralCommandType::ChannelUp;
|
||||
}
|
||||
if (str == QStringLiteral("ChannelDown")) {
|
||||
return GeneralCommandType::ChannelDown;
|
||||
}
|
||||
if (str == QStringLiteral("Guide")) {
|
||||
return GeneralCommandType::Guide;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleStats")) {
|
||||
return GeneralCommandType::ToggleStats;
|
||||
}
|
||||
if (str == QStringLiteral("PlayMediaSource")) {
|
||||
return GeneralCommandType::PlayMediaSource;
|
||||
}
|
||||
if (str == QStringLiteral("PlayTrailers")) {
|
||||
return GeneralCommandType::PlayTrailers;
|
||||
}
|
||||
if (str == QStringLiteral("SetShuffleQueue")) {
|
||||
return GeneralCommandType::SetShuffleQueue;
|
||||
}
|
||||
if (str == QStringLiteral("PlayState")) {
|
||||
return GeneralCommandType::PlayState;
|
||||
}
|
||||
if (str == QStringLiteral("PlayNext")) {
|
||||
return GeneralCommandType::PlayNext;
|
||||
}
|
||||
if (str == QStringLiteral("ToggleOsdMenu")) {
|
||||
return GeneralCommandType::ToggleOsdMenu;
|
||||
}
|
||||
if (str == QStringLiteral("Play")) {
|
||||
return GeneralCommandType::Play;
|
||||
}
|
||||
|
||||
return GeneralCommandType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,74 +32,75 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
GetProgramsDto::GetProgramsDto(QObject *parent) {}
|
||||
GetProgramsDto::GetProgramsDto() {}
|
||||
|
||||
GetProgramsDto GetProgramsDto::fromJson(QJsonObject source) {GetProgramsDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
GetProgramsDto GetProgramsDto::fromJson(QJsonObject source) {
|
||||
GetProgramsDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void GetProgramsDto::setFromJson(QJsonObject source) {
|
||||
m_channelIds = fromJsonValue<QList<QUuid>>(source["ChannelIds"]);
|
||||
m_userId = fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_minStartDate = fromJsonValue<QDateTime>(source["MinStartDate"]);
|
||||
m_hasAired = fromJsonValue<bool>(source["HasAired"]);
|
||||
m_isAiring = fromJsonValue<bool>(source["IsAiring"]);
|
||||
m_maxStartDate = fromJsonValue<QDateTime>(source["MaxStartDate"]);
|
||||
m_minEndDate = fromJsonValue<QDateTime>(source["MinEndDate"]);
|
||||
m_maxEndDate = fromJsonValue<QDateTime>(source["MaxEndDate"]);
|
||||
m_isMovie = fromJsonValue<bool>(source["IsMovie"]);
|
||||
m_isSeries = fromJsonValue<bool>(source["IsSeries"]);
|
||||
m_isNews = fromJsonValue<bool>(source["IsNews"]);
|
||||
m_isKids = fromJsonValue<bool>(source["IsKids"]);
|
||||
m_isSports = fromJsonValue<bool>(source["IsSports"]);
|
||||
m_startIndex = fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_limit = fromJsonValue<qint32>(source["Limit"]);
|
||||
m_sortBy = fromJsonValue<QString>(source["SortBy"]);
|
||||
m_sortOrder = fromJsonValue<QString>(source["SortOrder"]);
|
||||
m_genres = fromJsonValue<QStringList>(source["Genres"]);
|
||||
m_genreIds = fromJsonValue<QList<QUuid>>(source["GenreIds"]);
|
||||
m_enableImages = fromJsonValue<bool>(source["EnableImages"]);
|
||||
m_enableTotalRecordCount = fromJsonValue<bool>(source["EnableTotalRecordCount"]);
|
||||
m_imageTypeLimit = fromJsonValue<qint32>(source["ImageTypeLimit"]);
|
||||
m_enableImageTypes = fromJsonValue<QList<ImageType>>(source["EnableImageTypes"]);
|
||||
m_enableUserData = fromJsonValue<bool>(source["EnableUserData"]);
|
||||
m_seriesTimerId = fromJsonValue<QString>(source["SeriesTimerId"]);
|
||||
m_librarySeriesId = fromJsonValue<QUuid>(source["LibrarySeriesId"]);
|
||||
m_fields = fromJsonValue<QList<ItemFields>>(source["Fields"]);
|
||||
m_channelIds = Jellyfin::Support::fromJsonValue<QList<QUuid>>(source["ChannelIds"]);
|
||||
m_userId = Jellyfin::Support::fromJsonValue<QUuid>(source["UserId"]);
|
||||
m_minStartDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["MinStartDate"]);
|
||||
m_hasAired = Jellyfin::Support::fromJsonValue<bool>(source["HasAired"]);
|
||||
m_isAiring = Jellyfin::Support::fromJsonValue<bool>(source["IsAiring"]);
|
||||
m_maxStartDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["MaxStartDate"]);
|
||||
m_minEndDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["MinEndDate"]);
|
||||
m_maxEndDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["MaxEndDate"]);
|
||||
m_isMovie = Jellyfin::Support::fromJsonValue<bool>(source["IsMovie"]);
|
||||
m_isSeries = Jellyfin::Support::fromJsonValue<bool>(source["IsSeries"]);
|
||||
m_isNews = Jellyfin::Support::fromJsonValue<bool>(source["IsNews"]);
|
||||
m_isKids = Jellyfin::Support::fromJsonValue<bool>(source["IsKids"]);
|
||||
m_isSports = Jellyfin::Support::fromJsonValue<bool>(source["IsSports"]);
|
||||
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
|
||||
m_limit = Jellyfin::Support::fromJsonValue<qint32>(source["Limit"]);
|
||||
m_sortBy = Jellyfin::Support::fromJsonValue<QString>(source["SortBy"]);
|
||||
m_sortOrder = Jellyfin::Support::fromJsonValue<QString>(source["SortOrder"]);
|
||||
m_genres = Jellyfin::Support::fromJsonValue<QStringList>(source["Genres"]);
|
||||
m_genreIds = Jellyfin::Support::fromJsonValue<QList<QUuid>>(source["GenreIds"]);
|
||||
m_enableImages = Jellyfin::Support::fromJsonValue<bool>(source["EnableImages"]);
|
||||
m_enableTotalRecordCount = Jellyfin::Support::fromJsonValue<bool>(source["EnableTotalRecordCount"]);
|
||||
m_imageTypeLimit = Jellyfin::Support::fromJsonValue<qint32>(source["ImageTypeLimit"]);
|
||||
m_enableImageTypes = Jellyfin::Support::fromJsonValue<QList<ImageType>>(source["EnableImageTypes"]);
|
||||
m_enableUserData = Jellyfin::Support::fromJsonValue<bool>(source["EnableUserData"]);
|
||||
m_seriesTimerId = Jellyfin::Support::fromJsonValue<QString>(source["SeriesTimerId"]);
|
||||
m_librarySeriesId = Jellyfin::Support::fromJsonValue<QUuid>(source["LibrarySeriesId"]);
|
||||
m_fields = Jellyfin::Support::fromJsonValue<QList<ItemFields>>(source["Fields"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject GetProgramsDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["ChannelIds"] = toJsonValue<QList<QUuid>>(m_channelIds);
|
||||
result["UserId"] = toJsonValue<QUuid>(m_userId);
|
||||
result["MinStartDate"] = toJsonValue<QDateTime>(m_minStartDate);
|
||||
result["HasAired"] = toJsonValue<bool>(m_hasAired);
|
||||
result["IsAiring"] = toJsonValue<bool>(m_isAiring);
|
||||
result["MaxStartDate"] = toJsonValue<QDateTime>(m_maxStartDate);
|
||||
result["MinEndDate"] = toJsonValue<QDateTime>(m_minEndDate);
|
||||
result["MaxEndDate"] = toJsonValue<QDateTime>(m_maxEndDate);
|
||||
result["IsMovie"] = toJsonValue<bool>(m_isMovie);
|
||||
result["IsSeries"] = toJsonValue<bool>(m_isSeries);
|
||||
result["IsNews"] = toJsonValue<bool>(m_isNews);
|
||||
result["IsKids"] = toJsonValue<bool>(m_isKids);
|
||||
result["IsSports"] = toJsonValue<bool>(m_isSports);
|
||||
result["StartIndex"] = toJsonValue<qint32>(m_startIndex);
|
||||
result["Limit"] = toJsonValue<qint32>(m_limit);
|
||||
result["SortBy"] = toJsonValue<QString>(m_sortBy);
|
||||
result["SortOrder"] = toJsonValue<QString>(m_sortOrder);
|
||||
result["Genres"] = toJsonValue<QStringList>(m_genres);
|
||||
result["GenreIds"] = toJsonValue<QList<QUuid>>(m_genreIds);
|
||||
result["EnableImages"] = toJsonValue<bool>(m_enableImages);
|
||||
result["EnableTotalRecordCount"] = toJsonValue<bool>(m_enableTotalRecordCount);
|
||||
result["ImageTypeLimit"] = toJsonValue<qint32>(m_imageTypeLimit);
|
||||
result["EnableImageTypes"] = toJsonValue<QList<ImageType>>(m_enableImageTypes);
|
||||
result["EnableUserData"] = toJsonValue<bool>(m_enableUserData);
|
||||
result["SeriesTimerId"] = toJsonValue<QString>(m_seriesTimerId);
|
||||
result["LibrarySeriesId"] = toJsonValue<QUuid>(m_librarySeriesId);
|
||||
result["Fields"] = toJsonValue<QList<ItemFields>>(m_fields);
|
||||
result["ChannelIds"] = Jellyfin::Support::toJsonValue<QList<QUuid>>(m_channelIds);
|
||||
result["UserId"] = Jellyfin::Support::toJsonValue<QUuid>(m_userId);
|
||||
result["MinStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minStartDate);
|
||||
result["HasAired"] = Jellyfin::Support::toJsonValue<bool>(m_hasAired);
|
||||
result["IsAiring"] = Jellyfin::Support::toJsonValue<bool>(m_isAiring);
|
||||
result["MaxStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_maxStartDate);
|
||||
result["MinEndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minEndDate);
|
||||
result["MaxEndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_maxEndDate);
|
||||
result["IsMovie"] = Jellyfin::Support::toJsonValue<bool>(m_isMovie);
|
||||
result["IsSeries"] = Jellyfin::Support::toJsonValue<bool>(m_isSeries);
|
||||
result["IsNews"] = Jellyfin::Support::toJsonValue<bool>(m_isNews);
|
||||
result["IsKids"] = Jellyfin::Support::toJsonValue<bool>(m_isKids);
|
||||
result["IsSports"] = Jellyfin::Support::toJsonValue<bool>(m_isSports);
|
||||
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
|
||||
result["Limit"] = Jellyfin::Support::toJsonValue<qint32>(m_limit);
|
||||
result["SortBy"] = Jellyfin::Support::toJsonValue<QString>(m_sortBy);
|
||||
result["SortOrder"] = Jellyfin::Support::toJsonValue<QString>(m_sortOrder);
|
||||
result["Genres"] = Jellyfin::Support::toJsonValue<QStringList>(m_genres);
|
||||
result["GenreIds"] = Jellyfin::Support::toJsonValue<QList<QUuid>>(m_genreIds);
|
||||
result["EnableImages"] = Jellyfin::Support::toJsonValue<bool>(m_enableImages);
|
||||
result["EnableTotalRecordCount"] = Jellyfin::Support::toJsonValue<bool>(m_enableTotalRecordCount);
|
||||
result["ImageTypeLimit"] = Jellyfin::Support::toJsonValue<qint32>(m_imageTypeLimit);
|
||||
result["EnableImageTypes"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_enableImageTypes);
|
||||
result["EnableUserData"] = Jellyfin::Support::toJsonValue<bool>(m_enableUserData);
|
||||
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
|
||||
result["LibrarySeriesId"] = Jellyfin::Support::toJsonValue<QUuid>(m_librarySeriesId);
|
||||
result["Fields"] = Jellyfin::Support::toJsonValue<QList<ItemFields>>(m_fields);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -240,6 +241,17 @@ void GetProgramsDto::setFields(QList<ItemFields> newFields) {
|
|||
m_fields = newFields;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GetProgramsDto = Jellyfin::DTO::GetProgramsDto;
|
||||
|
||||
template <>
|
||||
GetProgramsDto fromJsonValue<GetProgramsDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return GetProgramsDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
GroupInfoDto::GroupInfoDto(QObject *parent) {}
|
||||
GroupInfoDto::GroupInfoDto() {}
|
||||
|
||||
GroupInfoDto GroupInfoDto::fromJson(QJsonObject source) {GroupInfoDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
GroupInfoDto GroupInfoDto::fromJson(QJsonObject source) {
|
||||
GroupInfoDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void GroupInfoDto::setFromJson(QJsonObject source) {
|
||||
m_groupId = fromJsonValue<QUuid>(source["GroupId"]);
|
||||
m_groupName = fromJsonValue<QString>(source["GroupName"]);
|
||||
m_state = fromJsonValue<GroupStateType>(source["State"]);
|
||||
m_participants = fromJsonValue<QStringList>(source["Participants"]);
|
||||
m_lastUpdatedAt = fromJsonValue<QDateTime>(source["LastUpdatedAt"]);
|
||||
m_groupId = Jellyfin::Support::fromJsonValue<QUuid>(source["GroupId"]);
|
||||
m_groupName = Jellyfin::Support::fromJsonValue<QString>(source["GroupName"]);
|
||||
m_state = Jellyfin::Support::fromJsonValue<GroupStateType>(source["State"]);
|
||||
m_participants = Jellyfin::Support::fromJsonValue<QStringList>(source["Participants"]);
|
||||
m_lastUpdatedAt = Jellyfin::Support::fromJsonValue<QDateTime>(source["LastUpdatedAt"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject GroupInfoDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["GroupId"] = toJsonValue<QUuid>(m_groupId);
|
||||
result["GroupName"] = toJsonValue<QString>(m_groupName);
|
||||
result["State"] = toJsonValue<GroupStateType>(m_state);
|
||||
result["Participants"] = toJsonValue<QStringList>(m_participants);
|
||||
result["LastUpdatedAt"] = toJsonValue<QDateTime>(m_lastUpdatedAt);
|
||||
result["GroupId"] = Jellyfin::Support::toJsonValue<QUuid>(m_groupId);
|
||||
result["GroupName"] = Jellyfin::Support::toJsonValue<QString>(m_groupName);
|
||||
result["State"] = Jellyfin::Support::toJsonValue<GroupStateType>(m_state);
|
||||
result["Participants"] = Jellyfin::Support::toJsonValue<QStringList>(m_participants);
|
||||
result["LastUpdatedAt"] = Jellyfin::Support::toJsonValue<QDateTime>(m_lastUpdatedAt);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void GroupInfoDto::setLastUpdatedAt(QDateTime newLastUpdatedAt) {
|
|||
m_lastUpdatedAt = newLastUpdatedAt;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupInfoDto = Jellyfin::DTO::GroupInfoDto;
|
||||
|
||||
template <>
|
||||
GroupInfoDto fromJsonValue<GroupInfoDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return GroupInfoDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
GroupQueueModeClass::GroupQueueModeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupQueueMode = Jellyfin::DTO::GroupQueueMode;
|
||||
|
||||
template <>
|
||||
GroupQueueMode fromJsonValue<GroupQueueMode>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GroupQueueMode::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Queue")) {
|
||||
return GroupQueueMode::Queue;
|
||||
}
|
||||
if (str == QStringLiteral("QueueNext")) {
|
||||
return GroupQueueMode::QueueNext;
|
||||
}
|
||||
|
||||
return GroupQueueMode::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
GroupRepeatModeClass::GroupRepeatModeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupRepeatMode = Jellyfin::DTO::GroupRepeatMode;
|
||||
|
||||
template <>
|
||||
GroupRepeatMode fromJsonValue<GroupRepeatMode>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GroupRepeatMode::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("RepeatOne")) {
|
||||
return GroupRepeatMode::RepeatOne;
|
||||
}
|
||||
if (str == QStringLiteral("RepeatAll")) {
|
||||
return GroupRepeatMode::RepeatAll;
|
||||
}
|
||||
if (str == QStringLiteral("RepeatNone")) {
|
||||
return GroupRepeatMode::RepeatNone;
|
||||
}
|
||||
|
||||
return GroupRepeatMode::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
GroupShuffleModeClass::GroupShuffleModeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupShuffleMode = Jellyfin::DTO::GroupShuffleMode;
|
||||
|
||||
template <>
|
||||
GroupShuffleMode fromJsonValue<GroupShuffleMode>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GroupShuffleMode::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Sorted")) {
|
||||
return GroupShuffleMode::Sorted;
|
||||
}
|
||||
if (str == QStringLiteral("Shuffle")) {
|
||||
return GroupShuffleMode::Shuffle;
|
||||
}
|
||||
|
||||
return GroupShuffleMode::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,33 @@ namespace DTO {
|
|||
|
||||
GroupStateTypeClass::GroupStateTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupStateType = Jellyfin::DTO::GroupStateType;
|
||||
|
||||
template <>
|
||||
GroupStateType fromJsonValue<GroupStateType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GroupStateType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Idle")) {
|
||||
return GroupStateType::Idle;
|
||||
}
|
||||
if (str == QStringLiteral("Waiting")) {
|
||||
return GroupStateType::Waiting;
|
||||
}
|
||||
if (str == QStringLiteral("Paused")) {
|
||||
return GroupStateType::Paused;
|
||||
}
|
||||
if (str == QStringLiteral("Playing")) {
|
||||
return GroupStateType::Playing;
|
||||
}
|
||||
|
||||
return GroupStateType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,54 @@ namespace DTO {
|
|||
|
||||
GroupUpdateTypeClass::GroupUpdateTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GroupUpdateType = Jellyfin::DTO::GroupUpdateType;
|
||||
|
||||
template <>
|
||||
GroupUpdateType fromJsonValue<GroupUpdateType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return GroupUpdateType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("UserJoined")) {
|
||||
return GroupUpdateType::UserJoined;
|
||||
}
|
||||
if (str == QStringLiteral("UserLeft")) {
|
||||
return GroupUpdateType::UserLeft;
|
||||
}
|
||||
if (str == QStringLiteral("GroupJoined")) {
|
||||
return GroupUpdateType::GroupJoined;
|
||||
}
|
||||
if (str == QStringLiteral("GroupLeft")) {
|
||||
return GroupUpdateType::GroupLeft;
|
||||
}
|
||||
if (str == QStringLiteral("StateUpdate")) {
|
||||
return GroupUpdateType::StateUpdate;
|
||||
}
|
||||
if (str == QStringLiteral("PlayQueue")) {
|
||||
return GroupUpdateType::PlayQueue;
|
||||
}
|
||||
if (str == QStringLiteral("NotInGroup")) {
|
||||
return GroupUpdateType::NotInGroup;
|
||||
}
|
||||
if (str == QStringLiteral("GroupDoesNotExist")) {
|
||||
return GroupUpdateType::GroupDoesNotExist;
|
||||
}
|
||||
if (str == QStringLiteral("CreateGroupDenied")) {
|
||||
return GroupUpdateType::CreateGroupDenied;
|
||||
}
|
||||
if (str == QStringLiteral("JoinGroupDenied")) {
|
||||
return GroupUpdateType::JoinGroupDenied;
|
||||
}
|
||||
if (str == QStringLiteral("LibraryAccessDenied")) {
|
||||
return GroupUpdateType::LibraryAccessDenied;
|
||||
}
|
||||
|
||||
return GroupUpdateType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
GuideInfo::GuideInfo(QObject *parent) {}
|
||||
GuideInfo::GuideInfo() {}
|
||||
|
||||
GuideInfo GuideInfo::fromJson(QJsonObject source) {GuideInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
GuideInfo GuideInfo::fromJson(QJsonObject source) {
|
||||
GuideInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void GuideInfo::setFromJson(QJsonObject source) {
|
||||
m_startDate = fromJsonValue<QDateTime>(source["StartDate"]);
|
||||
m_endDate = fromJsonValue<QDateTime>(source["EndDate"]);
|
||||
m_startDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["StartDate"]);
|
||||
m_endDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["EndDate"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject GuideInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["StartDate"] = toJsonValue<QDateTime>(m_startDate);
|
||||
result["EndDate"] = toJsonValue<QDateTime>(m_endDate);
|
||||
result["StartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_startDate);
|
||||
result["EndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_endDate);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void GuideInfo::setEndDate(QDateTime newEndDate) {
|
|||
m_endDate = newEndDate;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using GuideInfo = Jellyfin::DTO::GuideInfo;
|
||||
|
||||
template <>
|
||||
GuideInfo fromJsonValue<GuideInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return GuideInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,30 @@ namespace DTO {
|
|||
|
||||
HeaderMatchTypeClass::HeaderMatchTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using HeaderMatchType = Jellyfin::DTO::HeaderMatchType;
|
||||
|
||||
template <>
|
||||
HeaderMatchType fromJsonValue<HeaderMatchType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return HeaderMatchType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Equals")) {
|
||||
return HeaderMatchType::Equals;
|
||||
}
|
||||
if (str == QStringLiteral("Regex")) {
|
||||
return HeaderMatchType::Regex;
|
||||
}
|
||||
if (str == QStringLiteral("Substring")) {
|
||||
return HeaderMatchType::Substring;
|
||||
}
|
||||
|
||||
return HeaderMatchType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
HttpHeaderInfo::HttpHeaderInfo(QObject *parent) {}
|
||||
HttpHeaderInfo::HttpHeaderInfo() {}
|
||||
|
||||
HttpHeaderInfo HttpHeaderInfo::fromJson(QJsonObject source) {HttpHeaderInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
HttpHeaderInfo HttpHeaderInfo::fromJson(QJsonObject source) {
|
||||
HttpHeaderInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void HttpHeaderInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_value = fromJsonValue<QString>(source["Value"]);
|
||||
m_match = fromJsonValue<HeaderMatchType>(source["Match"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_value = Jellyfin::Support::fromJsonValue<QString>(source["Value"]);
|
||||
m_match = Jellyfin::Support::fromJsonValue<HeaderMatchType>(source["Match"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject HttpHeaderInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Value"] = toJsonValue<QString>(m_value);
|
||||
result["Match"] = toJsonValue<HeaderMatchType>(m_match);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
|
||||
result["Match"] = Jellyfin::Support::toJsonValue<HeaderMatchType>(m_match);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void HttpHeaderInfo::setMatch(HeaderMatchType newMatch) {
|
|||
m_match = newMatch;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo;
|
||||
|
||||
template <>
|
||||
HttpHeaderInfo fromJsonValue<HttpHeaderInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return HttpHeaderInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
IgnoreWaitRequestDto::IgnoreWaitRequestDto(QObject *parent) {}
|
||||
IgnoreWaitRequestDto::IgnoreWaitRequestDto() {}
|
||||
|
||||
IgnoreWaitRequestDto IgnoreWaitRequestDto::fromJson(QJsonObject source) {IgnoreWaitRequestDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
IgnoreWaitRequestDto IgnoreWaitRequestDto::fromJson(QJsonObject source) {
|
||||
IgnoreWaitRequestDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void IgnoreWaitRequestDto::setFromJson(QJsonObject source) {
|
||||
m_ignoreWait = fromJsonValue<bool>(source["IgnoreWait"]);
|
||||
m_ignoreWait = Jellyfin::Support::fromJsonValue<bool>(source["IgnoreWait"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject IgnoreWaitRequestDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["IgnoreWait"] = toJsonValue<bool>(m_ignoreWait);
|
||||
result["IgnoreWait"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreWait);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void IgnoreWaitRequestDto::setIgnoreWait(bool newIgnoreWait) {
|
|||
m_ignoreWait = newIgnoreWait;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using IgnoreWaitRequestDto = Jellyfin::DTO::IgnoreWaitRequestDto;
|
||||
|
||||
template <>
|
||||
IgnoreWaitRequestDto fromJsonValue<IgnoreWaitRequestDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return IgnoreWaitRequestDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,30 +32,31 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ImageByNameInfo::ImageByNameInfo(QObject *parent) {}
|
||||
ImageByNameInfo::ImageByNameInfo() {}
|
||||
|
||||
ImageByNameInfo ImageByNameInfo::fromJson(QJsonObject source) {ImageByNameInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ImageByNameInfo ImageByNameInfo::fromJson(QJsonObject source) {
|
||||
ImageByNameInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ImageByNameInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_theme = fromJsonValue<QString>(source["Theme"]);
|
||||
m_context = fromJsonValue<QString>(source["Context"]);
|
||||
m_fileLength = fromJsonValue<qint64>(source["FileLength"]);
|
||||
m_format = fromJsonValue<QString>(source["Format"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_theme = Jellyfin::Support::fromJsonValue<QString>(source["Theme"]);
|
||||
m_context = Jellyfin::Support::fromJsonValue<QString>(source["Context"]);
|
||||
m_fileLength = Jellyfin::Support::fromJsonValue<qint64>(source["FileLength"]);
|
||||
m_format = Jellyfin::Support::fromJsonValue<QString>(source["Format"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ImageByNameInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Theme"] = toJsonValue<QString>(m_theme);
|
||||
result["Context"] = toJsonValue<QString>(m_context);
|
||||
result["FileLength"] = toJsonValue<qint64>(m_fileLength);
|
||||
result["Format"] = toJsonValue<QString>(m_format);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Theme"] = Jellyfin::Support::toJsonValue<QString>(m_theme);
|
||||
result["Context"] = Jellyfin::Support::toJsonValue<QString>(m_context);
|
||||
result["FileLength"] = Jellyfin::Support::toJsonValue<qint64>(m_fileLength);
|
||||
result["Format"] = Jellyfin::Support::toJsonValue<QString>(m_format);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -86,6 +87,17 @@ void ImageByNameInfo::setFormat(QString newFormat) {
|
|||
m_format = newFormat;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo;
|
||||
|
||||
template <>
|
||||
ImageByNameInfo fromJsonValue<ImageByNameInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ImageByNameInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,36 @@ namespace DTO {
|
|||
|
||||
ImageFormatClass::ImageFormatClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageFormat = Jellyfin::DTO::ImageFormat;
|
||||
|
||||
template <>
|
||||
ImageFormat fromJsonValue<ImageFormat>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ImageFormat::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Bmp")) {
|
||||
return ImageFormat::Bmp;
|
||||
}
|
||||
if (str == QStringLiteral("Gif")) {
|
||||
return ImageFormat::Gif;
|
||||
}
|
||||
if (str == QStringLiteral("Jpg")) {
|
||||
return ImageFormat::Jpg;
|
||||
}
|
||||
if (str == QStringLiteral("Png")) {
|
||||
return ImageFormat::Png;
|
||||
}
|
||||
if (str == QStringLiteral("Webp")) {
|
||||
return ImageFormat::Webp;
|
||||
}
|
||||
|
||||
return ImageFormat::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,36 +32,37 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ImageInfo::ImageInfo(QObject *parent) {}
|
||||
ImageInfo::ImageInfo() {}
|
||||
|
||||
ImageInfo ImageInfo::fromJson(QJsonObject source) {ImageInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ImageInfo ImageInfo::fromJson(QJsonObject source) {
|
||||
ImageInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ImageInfo::setFromJson(QJsonObject source) {
|
||||
m_imageType = fromJsonValue<ImageType>(source["ImageType"]);
|
||||
m_imageIndex = fromJsonValue<qint32>(source["ImageIndex"]);
|
||||
m_imageTag = fromJsonValue<QString>(source["ImageTag"]);
|
||||
m_path = fromJsonValue<QString>(source["Path"]);
|
||||
m_blurHash = fromJsonValue<QString>(source["BlurHash"]);
|
||||
m_height = fromJsonValue<qint32>(source["Height"]);
|
||||
m_width = fromJsonValue<qint32>(source["Width"]);
|
||||
m_size = fromJsonValue<qint64>(source["Size"]);
|
||||
m_imageType = Jellyfin::Support::fromJsonValue<ImageType>(source["ImageType"]);
|
||||
m_imageIndex = Jellyfin::Support::fromJsonValue<qint32>(source["ImageIndex"]);
|
||||
m_imageTag = Jellyfin::Support::fromJsonValue<QString>(source["ImageTag"]);
|
||||
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
|
||||
m_blurHash = Jellyfin::Support::fromJsonValue<QString>(source["BlurHash"]);
|
||||
m_height = Jellyfin::Support::fromJsonValue<qint32>(source["Height"]);
|
||||
m_width = Jellyfin::Support::fromJsonValue<qint32>(source["Width"]);
|
||||
m_size = Jellyfin::Support::fromJsonValue<qint64>(source["Size"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ImageInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["ImageType"] = toJsonValue<ImageType>(m_imageType);
|
||||
result["ImageIndex"] = toJsonValue<qint32>(m_imageIndex);
|
||||
result["ImageTag"] = toJsonValue<QString>(m_imageTag);
|
||||
result["Path"] = toJsonValue<QString>(m_path);
|
||||
result["BlurHash"] = toJsonValue<QString>(m_blurHash);
|
||||
result["Height"] = toJsonValue<qint32>(m_height);
|
||||
result["Width"] = toJsonValue<qint32>(m_width);
|
||||
result["Size"] = toJsonValue<qint64>(m_size);
|
||||
result["ImageType"] = Jellyfin::Support::toJsonValue<ImageType>(m_imageType);
|
||||
result["ImageIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_imageIndex);
|
||||
result["ImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_imageTag);
|
||||
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
|
||||
result["BlurHash"] = Jellyfin::Support::toJsonValue<QString>(m_blurHash);
|
||||
result["Height"] = Jellyfin::Support::toJsonValue<qint32>(m_height);
|
||||
result["Width"] = Jellyfin::Support::toJsonValue<qint32>(m_width);
|
||||
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -107,6 +108,17 @@ void ImageInfo::setSize(qint64 newSize) {
|
|||
m_size = newSize;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageInfo = Jellyfin::DTO::ImageInfo;
|
||||
|
||||
template <>
|
||||
ImageInfo fromJsonValue<ImageInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ImageInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,26 +32,27 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ImageOption::ImageOption(QObject *parent) {}
|
||||
ImageOption::ImageOption() {}
|
||||
|
||||
ImageOption ImageOption::fromJson(QJsonObject source) {ImageOption instance;
|
||||
instance->setFromJson(source, false);
|
||||
ImageOption ImageOption::fromJson(QJsonObject source) {
|
||||
ImageOption instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ImageOption::setFromJson(QJsonObject source) {
|
||||
m_type = fromJsonValue<ImageType>(source["Type"]);
|
||||
m_limit = fromJsonValue<qint32>(source["Limit"]);
|
||||
m_minWidth = fromJsonValue<qint32>(source["MinWidth"]);
|
||||
m_type = Jellyfin::Support::fromJsonValue<ImageType>(source["Type"]);
|
||||
m_limit = Jellyfin::Support::fromJsonValue<qint32>(source["Limit"]);
|
||||
m_minWidth = Jellyfin::Support::fromJsonValue<qint32>(source["MinWidth"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ImageOption::toJson() {
|
||||
QJsonObject result;
|
||||
result["Type"] = toJsonValue<ImageType>(m_type);
|
||||
result["Limit"] = toJsonValue<qint32>(m_limit);
|
||||
result["MinWidth"] = toJsonValue<qint32>(m_minWidth);
|
||||
result["Type"] = Jellyfin::Support::toJsonValue<ImageType>(m_type);
|
||||
result["Limit"] = Jellyfin::Support::toJsonValue<qint32>(m_limit);
|
||||
result["MinWidth"] = Jellyfin::Support::toJsonValue<qint32>(m_minWidth);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -72,6 +73,17 @@ void ImageOption::setMinWidth(qint32 newMinWidth) {
|
|||
m_minWidth = newMinWidth;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageOption = Jellyfin::DTO::ImageOption;
|
||||
|
||||
template <>
|
||||
ImageOption fromJsonValue<ImageOption>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ImageOption::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,45 @@ namespace DTO {
|
|||
|
||||
ImageOrientationClass::ImageOrientationClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageOrientation = Jellyfin::DTO::ImageOrientation;
|
||||
|
||||
template <>
|
||||
ImageOrientation fromJsonValue<ImageOrientation>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ImageOrientation::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("TopLeft")) {
|
||||
return ImageOrientation::TopLeft;
|
||||
}
|
||||
if (str == QStringLiteral("TopRight")) {
|
||||
return ImageOrientation::TopRight;
|
||||
}
|
||||
if (str == QStringLiteral("BottomRight")) {
|
||||
return ImageOrientation::BottomRight;
|
||||
}
|
||||
if (str == QStringLiteral("BottomLeft")) {
|
||||
return ImageOrientation::BottomLeft;
|
||||
}
|
||||
if (str == QStringLiteral("LeftTop")) {
|
||||
return ImageOrientation::LeftTop;
|
||||
}
|
||||
if (str == QStringLiteral("RightTop")) {
|
||||
return ImageOrientation::RightTop;
|
||||
}
|
||||
if (str == QStringLiteral("RightBottom")) {
|
||||
return ImageOrientation::RightBottom;
|
||||
}
|
||||
if (str == QStringLiteral("LeftBottom")) {
|
||||
return ImageOrientation::LeftBottom;
|
||||
}
|
||||
|
||||
return ImageOrientation::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,24 +32,25 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ImageProviderInfo::ImageProviderInfo(QObject *parent) {}
|
||||
ImageProviderInfo::ImageProviderInfo() {}
|
||||
|
||||
ImageProviderInfo ImageProviderInfo::fromJson(QJsonObject source) {ImageProviderInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
ImageProviderInfo ImageProviderInfo::fromJson(QJsonObject source) {
|
||||
ImageProviderInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ImageProviderInfo::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_supportedImages = fromJsonValue<QList<ImageType>>(source["SupportedImages"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_supportedImages = Jellyfin::Support::fromJsonValue<QList<ImageType>>(source["SupportedImages"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ImageProviderInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["SupportedImages"] = toJsonValue<QList<ImageType>>(m_supportedImages);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["SupportedImages"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImages);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -65,6 +66,17 @@ void ImageProviderInfo::setSupportedImages(QList<ImageType> newSupportedImages)
|
|||
m_supportedImages = newSupportedImages;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageProviderInfo = Jellyfin::DTO::ImageProviderInfo;
|
||||
|
||||
template <>
|
||||
ImageProviderInfo fromJsonValue<ImageProviderInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ImageProviderInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
ImageSavingConventionClass::ImageSavingConventionClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageSavingConvention = Jellyfin::DTO::ImageSavingConvention;
|
||||
|
||||
template <>
|
||||
ImageSavingConvention fromJsonValue<ImageSavingConvention>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ImageSavingConvention::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Legacy")) {
|
||||
return ImageSavingConvention::Legacy;
|
||||
}
|
||||
if (str == QStringLiteral("Compatible")) {
|
||||
return ImageSavingConvention::Compatible;
|
||||
}
|
||||
|
||||
return ImageSavingConvention::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,60 @@ namespace DTO {
|
|||
|
||||
ImageTypeClass::ImageTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ImageType = Jellyfin::DTO::ImageType;
|
||||
|
||||
template <>
|
||||
ImageType fromJsonValue<ImageType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ImageType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Primary")) {
|
||||
return ImageType::Primary;
|
||||
}
|
||||
if (str == QStringLiteral("Art")) {
|
||||
return ImageType::Art;
|
||||
}
|
||||
if (str == QStringLiteral("Backdrop")) {
|
||||
return ImageType::Backdrop;
|
||||
}
|
||||
if (str == QStringLiteral("Banner")) {
|
||||
return ImageType::Banner;
|
||||
}
|
||||
if (str == QStringLiteral("Logo")) {
|
||||
return ImageType::Logo;
|
||||
}
|
||||
if (str == QStringLiteral("Thumb")) {
|
||||
return ImageType::Thumb;
|
||||
}
|
||||
if (str == QStringLiteral("Disc")) {
|
||||
return ImageType::Disc;
|
||||
}
|
||||
if (str == QStringLiteral("Box")) {
|
||||
return ImageType::Box;
|
||||
}
|
||||
if (str == QStringLiteral("Screenshot")) {
|
||||
return ImageType::Screenshot;
|
||||
}
|
||||
if (str == QStringLiteral("Menu")) {
|
||||
return ImageType::Menu;
|
||||
}
|
||||
if (str == QStringLiteral("Chapter")) {
|
||||
return ImageType::Chapter;
|
||||
}
|
||||
if (str == QStringLiteral("BoxRear")) {
|
||||
return ImageType::BoxRear;
|
||||
}
|
||||
if (str == QStringLiteral("Profile")) {
|
||||
return ImageType::Profile;
|
||||
}
|
||||
|
||||
return ImageType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,32 +32,33 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
InstallationInfo::InstallationInfo(QObject *parent) {}
|
||||
InstallationInfo::InstallationInfo() {}
|
||||
|
||||
InstallationInfo InstallationInfo::fromJson(QJsonObject source) {InstallationInfo instance;
|
||||
instance->setFromJson(source, false);
|
||||
InstallationInfo InstallationInfo::fromJson(QJsonObject source) {
|
||||
InstallationInfo instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void InstallationInfo::setFromJson(QJsonObject source) {
|
||||
m_guid = fromJsonValue<QUuid>(source["Guid"]);
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_version = fromJsonValue<QSharedPointer<Version>>(source["Version"]);
|
||||
m_changelog = fromJsonValue<QString>(source["Changelog"]);
|
||||
m_sourceUrl = fromJsonValue<QString>(source["SourceUrl"]);
|
||||
m_checksum = fromJsonValue<QString>(source["Checksum"]);
|
||||
m_guid = Jellyfin::Support::fromJsonValue<QUuid>(source["Guid"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_version = Jellyfin::Support::fromJsonValue<QSharedPointer<Version>>(source["Version"]);
|
||||
m_changelog = Jellyfin::Support::fromJsonValue<QString>(source["Changelog"]);
|
||||
m_sourceUrl = Jellyfin::Support::fromJsonValue<QString>(source["SourceUrl"]);
|
||||
m_checksum = Jellyfin::Support::fromJsonValue<QString>(source["Checksum"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject InstallationInfo::toJson() {
|
||||
QJsonObject result;
|
||||
result["Guid"] = toJsonValue<QUuid>(m_guid);
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Version"] = toJsonValue<QSharedPointer<Version>>(m_version);
|
||||
result["Changelog"] = toJsonValue<QString>(m_changelog);
|
||||
result["SourceUrl"] = toJsonValue<QString>(m_sourceUrl);
|
||||
result["Checksum"] = toJsonValue<QString>(m_checksum);
|
||||
result["Guid"] = Jellyfin::Support::toJsonValue<QUuid>(m_guid);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Version"] = Jellyfin::Support::toJsonValue<QSharedPointer<Version>>(m_version);
|
||||
result["Changelog"] = Jellyfin::Support::toJsonValue<QString>(m_changelog);
|
||||
result["SourceUrl"] = Jellyfin::Support::toJsonValue<QString>(m_sourceUrl);
|
||||
result["Checksum"] = Jellyfin::Support::toJsonValue<QString>(m_checksum);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -93,6 +94,17 @@ void InstallationInfo::setChecksum(QString newChecksum) {
|
|||
m_checksum = newChecksum;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using InstallationInfo = Jellyfin::DTO::InstallationInfo;
|
||||
|
||||
template <>
|
||||
InstallationInfo fromJsonValue<InstallationInfo>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return InstallationInfo::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,34 +32,35 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
IPlugin::IPlugin(QObject *parent) {}
|
||||
IPlugin::IPlugin() {}
|
||||
|
||||
IPlugin IPlugin::fromJson(QJsonObject source) {IPlugin instance;
|
||||
instance->setFromJson(source, false);
|
||||
IPlugin IPlugin::fromJson(QJsonObject source) {
|
||||
IPlugin instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void IPlugin::setFromJson(QJsonObject source) {
|
||||
m_name = fromJsonValue<QString>(source["Name"]);
|
||||
m_description = fromJsonValue<QString>(source["Description"]);
|
||||
m_jellyfinId = fromJsonValue<QUuid>(source["Id"]);
|
||||
m_version = fromJsonValue<QSharedPointer<Version>>(source["Version"]);
|
||||
m_assemblyFilePath = fromJsonValue<QString>(source["AssemblyFilePath"]);
|
||||
m_canUninstall = fromJsonValue<bool>(source["CanUninstall"]);
|
||||
m_dataFolderPath = fromJsonValue<QString>(source["DataFolderPath"]);
|
||||
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
|
||||
m_description = Jellyfin::Support::fromJsonValue<QString>(source["Description"]);
|
||||
m_jellyfinId = Jellyfin::Support::fromJsonValue<QUuid>(source["Id"]);
|
||||
m_version = Jellyfin::Support::fromJsonValue<QSharedPointer<Version>>(source["Version"]);
|
||||
m_assemblyFilePath = Jellyfin::Support::fromJsonValue<QString>(source["AssemblyFilePath"]);
|
||||
m_canUninstall = Jellyfin::Support::fromJsonValue<bool>(source["CanUninstall"]);
|
||||
m_dataFolderPath = Jellyfin::Support::fromJsonValue<QString>(source["DataFolderPath"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject IPlugin::toJson() {
|
||||
QJsonObject result;
|
||||
result["Name"] = toJsonValue<QString>(m_name);
|
||||
result["Description"] = toJsonValue<QString>(m_description);
|
||||
result["Id"] = toJsonValue<QUuid>(m_jellyfinId);
|
||||
result["Version"] = toJsonValue<QSharedPointer<Version>>(m_version);
|
||||
result["AssemblyFilePath"] = toJsonValue<QString>(m_assemblyFilePath);
|
||||
result["CanUninstall"] = toJsonValue<bool>(m_canUninstall);
|
||||
result["DataFolderPath"] = toJsonValue<QString>(m_dataFolderPath);
|
||||
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
|
||||
result["Description"] = Jellyfin::Support::toJsonValue<QString>(m_description);
|
||||
result["Id"] = Jellyfin::Support::toJsonValue<QUuid>(m_jellyfinId);
|
||||
result["Version"] = Jellyfin::Support::toJsonValue<QSharedPointer<Version>>(m_version);
|
||||
result["AssemblyFilePath"] = Jellyfin::Support::toJsonValue<QString>(m_assemblyFilePath);
|
||||
result["CanUninstall"] = Jellyfin::Support::toJsonValue<bool>(m_canUninstall);
|
||||
result["DataFolderPath"] = Jellyfin::Support::toJsonValue<QString>(m_dataFolderPath);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -100,6 +101,17 @@ void IPlugin::setDataFolderPath(QString newDataFolderPath) {
|
|||
m_dataFolderPath = newDataFolderPath;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using IPlugin = Jellyfin::DTO::IPlugin;
|
||||
|
||||
template <>
|
||||
IPlugin fromJsonValue<IPlugin>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return IPlugin::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,27 @@ namespace DTO {
|
|||
|
||||
IsoTypeClass::IsoTypeClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using IsoType = Jellyfin::DTO::IsoType;
|
||||
|
||||
template <>
|
||||
IsoType fromJsonValue<IsoType>(const QJsonValue &source) {
|
||||
if (!source.isString()) return IsoType::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("Dvd")) {
|
||||
return IsoType::Dvd;
|
||||
}
|
||||
if (str == QStringLiteral("BluRay")) {
|
||||
return IsoType::BluRay;
|
||||
}
|
||||
|
||||
return IsoType::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,44 +32,45 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
ItemCounts::ItemCounts(QObject *parent) {}
|
||||
ItemCounts::ItemCounts() {}
|
||||
|
||||
ItemCounts ItemCounts::fromJson(QJsonObject source) {ItemCounts instance;
|
||||
instance->setFromJson(source, false);
|
||||
ItemCounts ItemCounts::fromJson(QJsonObject source) {
|
||||
ItemCounts instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void ItemCounts::setFromJson(QJsonObject source) {
|
||||
m_movieCount = fromJsonValue<qint32>(source["MovieCount"]);
|
||||
m_seriesCount = fromJsonValue<qint32>(source["SeriesCount"]);
|
||||
m_episodeCount = fromJsonValue<qint32>(source["EpisodeCount"]);
|
||||
m_artistCount = fromJsonValue<qint32>(source["ArtistCount"]);
|
||||
m_programCount = fromJsonValue<qint32>(source["ProgramCount"]);
|
||||
m_trailerCount = fromJsonValue<qint32>(source["TrailerCount"]);
|
||||
m_songCount = fromJsonValue<qint32>(source["SongCount"]);
|
||||
m_albumCount = fromJsonValue<qint32>(source["AlbumCount"]);
|
||||
m_musicVideoCount = fromJsonValue<qint32>(source["MusicVideoCount"]);
|
||||
m_boxSetCount = fromJsonValue<qint32>(source["BoxSetCount"]);
|
||||
m_bookCount = fromJsonValue<qint32>(source["BookCount"]);
|
||||
m_itemCount = fromJsonValue<qint32>(source["ItemCount"]);
|
||||
m_movieCount = Jellyfin::Support::fromJsonValue<qint32>(source["MovieCount"]);
|
||||
m_seriesCount = Jellyfin::Support::fromJsonValue<qint32>(source["SeriesCount"]);
|
||||
m_episodeCount = Jellyfin::Support::fromJsonValue<qint32>(source["EpisodeCount"]);
|
||||
m_artistCount = Jellyfin::Support::fromJsonValue<qint32>(source["ArtistCount"]);
|
||||
m_programCount = Jellyfin::Support::fromJsonValue<qint32>(source["ProgramCount"]);
|
||||
m_trailerCount = Jellyfin::Support::fromJsonValue<qint32>(source["TrailerCount"]);
|
||||
m_songCount = Jellyfin::Support::fromJsonValue<qint32>(source["SongCount"]);
|
||||
m_albumCount = Jellyfin::Support::fromJsonValue<qint32>(source["AlbumCount"]);
|
||||
m_musicVideoCount = Jellyfin::Support::fromJsonValue<qint32>(source["MusicVideoCount"]);
|
||||
m_boxSetCount = Jellyfin::Support::fromJsonValue<qint32>(source["BoxSetCount"]);
|
||||
m_bookCount = Jellyfin::Support::fromJsonValue<qint32>(source["BookCount"]);
|
||||
m_itemCount = Jellyfin::Support::fromJsonValue<qint32>(source["ItemCount"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject ItemCounts::toJson() {
|
||||
QJsonObject result;
|
||||
result["MovieCount"] = toJsonValue<qint32>(m_movieCount);
|
||||
result["SeriesCount"] = toJsonValue<qint32>(m_seriesCount);
|
||||
result["EpisodeCount"] = toJsonValue<qint32>(m_episodeCount);
|
||||
result["ArtistCount"] = toJsonValue<qint32>(m_artistCount);
|
||||
result["ProgramCount"] = toJsonValue<qint32>(m_programCount);
|
||||
result["TrailerCount"] = toJsonValue<qint32>(m_trailerCount);
|
||||
result["SongCount"] = toJsonValue<qint32>(m_songCount);
|
||||
result["AlbumCount"] = toJsonValue<qint32>(m_albumCount);
|
||||
result["MusicVideoCount"] = toJsonValue<qint32>(m_musicVideoCount);
|
||||
result["BoxSetCount"] = toJsonValue<qint32>(m_boxSetCount);
|
||||
result["BookCount"] = toJsonValue<qint32>(m_bookCount);
|
||||
result["ItemCount"] = toJsonValue<qint32>(m_itemCount);
|
||||
result["MovieCount"] = Jellyfin::Support::toJsonValue<qint32>(m_movieCount);
|
||||
result["SeriesCount"] = Jellyfin::Support::toJsonValue<qint32>(m_seriesCount);
|
||||
result["EpisodeCount"] = Jellyfin::Support::toJsonValue<qint32>(m_episodeCount);
|
||||
result["ArtistCount"] = Jellyfin::Support::toJsonValue<qint32>(m_artistCount);
|
||||
result["ProgramCount"] = Jellyfin::Support::toJsonValue<qint32>(m_programCount);
|
||||
result["TrailerCount"] = Jellyfin::Support::toJsonValue<qint32>(m_trailerCount);
|
||||
result["SongCount"] = Jellyfin::Support::toJsonValue<qint32>(m_songCount);
|
||||
result["AlbumCount"] = Jellyfin::Support::toJsonValue<qint32>(m_albumCount);
|
||||
result["MusicVideoCount"] = Jellyfin::Support::toJsonValue<qint32>(m_musicVideoCount);
|
||||
result["BoxSetCount"] = Jellyfin::Support::toJsonValue<qint32>(m_boxSetCount);
|
||||
result["BookCount"] = Jellyfin::Support::toJsonValue<qint32>(m_bookCount);
|
||||
result["ItemCount"] = Jellyfin::Support::toJsonValue<qint32>(m_itemCount);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -135,6 +136,17 @@ void ItemCounts::setItemCount(qint32 newItemCount) {
|
|||
m_itemCount = newItemCount;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ItemCounts = Jellyfin::DTO::ItemCounts;
|
||||
|
||||
template <>
|
||||
ItemCounts fromJsonValue<ItemCounts>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return ItemCounts::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,204 @@ namespace DTO {
|
|||
|
||||
ItemFieldsClass::ItemFieldsClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ItemFields = Jellyfin::DTO::ItemFields;
|
||||
|
||||
template <>
|
||||
ItemFields fromJsonValue<ItemFields>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ItemFields::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("AirTime")) {
|
||||
return ItemFields::AirTime;
|
||||
}
|
||||
if (str == QStringLiteral("CanDelete")) {
|
||||
return ItemFields::CanDelete;
|
||||
}
|
||||
if (str == QStringLiteral("CanDownload")) {
|
||||
return ItemFields::CanDownload;
|
||||
}
|
||||
if (str == QStringLiteral("ChannelInfo")) {
|
||||
return ItemFields::ChannelInfo;
|
||||
}
|
||||
if (str == QStringLiteral("Chapters")) {
|
||||
return ItemFields::Chapters;
|
||||
}
|
||||
if (str == QStringLiteral("ChildCount")) {
|
||||
return ItemFields::ChildCount;
|
||||
}
|
||||
if (str == QStringLiteral("CumulativeRunTimeTicks")) {
|
||||
return ItemFields::CumulativeRunTimeTicks;
|
||||
}
|
||||
if (str == QStringLiteral("CustomRating")) {
|
||||
return ItemFields::CustomRating;
|
||||
}
|
||||
if (str == QStringLiteral("DateCreated")) {
|
||||
return ItemFields::DateCreated;
|
||||
}
|
||||
if (str == QStringLiteral("DateLastMediaAdded")) {
|
||||
return ItemFields::DateLastMediaAdded;
|
||||
}
|
||||
if (str == QStringLiteral("DisplayPreferencesId")) {
|
||||
return ItemFields::DisplayPreferencesId;
|
||||
}
|
||||
if (str == QStringLiteral("Etag")) {
|
||||
return ItemFields::Etag;
|
||||
}
|
||||
if (str == QStringLiteral("ExternalUrls")) {
|
||||
return ItemFields::ExternalUrls;
|
||||
}
|
||||
if (str == QStringLiteral("Genres")) {
|
||||
return ItemFields::Genres;
|
||||
}
|
||||
if (str == QStringLiteral("HomePageUrl")) {
|
||||
return ItemFields::HomePageUrl;
|
||||
}
|
||||
if (str == QStringLiteral("ItemCounts")) {
|
||||
return ItemFields::ItemCounts;
|
||||
}
|
||||
if (str == QStringLiteral("MediaSourceCount")) {
|
||||
return ItemFields::MediaSourceCount;
|
||||
}
|
||||
if (str == QStringLiteral("MediaSources")) {
|
||||
return ItemFields::MediaSources;
|
||||
}
|
||||
if (str == QStringLiteral("OriginalTitle")) {
|
||||
return ItemFields::OriginalTitle;
|
||||
}
|
||||
if (str == QStringLiteral("Overview")) {
|
||||
return ItemFields::Overview;
|
||||
}
|
||||
if (str == QStringLiteral("ParentId")) {
|
||||
return ItemFields::ParentId;
|
||||
}
|
||||
if (str == QStringLiteral("Path")) {
|
||||
return ItemFields::Path;
|
||||
}
|
||||
if (str == QStringLiteral("People")) {
|
||||
return ItemFields::People;
|
||||
}
|
||||
if (str == QStringLiteral("PlayAccess")) {
|
||||
return ItemFields::PlayAccess;
|
||||
}
|
||||
if (str == QStringLiteral("ProductionLocations")) {
|
||||
return ItemFields::ProductionLocations;
|
||||
}
|
||||
if (str == QStringLiteral("ProviderIds")) {
|
||||
return ItemFields::ProviderIds;
|
||||
}
|
||||
if (str == QStringLiteral("PrimaryImageAspectRatio")) {
|
||||
return ItemFields::PrimaryImageAspectRatio;
|
||||
}
|
||||
if (str == QStringLiteral("RecursiveItemCount")) {
|
||||
return ItemFields::RecursiveItemCount;
|
||||
}
|
||||
if (str == QStringLiteral("Settings")) {
|
||||
return ItemFields::Settings;
|
||||
}
|
||||
if (str == QStringLiteral("ScreenshotImageTags")) {
|
||||
return ItemFields::ScreenshotImageTags;
|
||||
}
|
||||
if (str == QStringLiteral("SeriesPrimaryImage")) {
|
||||
return ItemFields::SeriesPrimaryImage;
|
||||
}
|
||||
if (str == QStringLiteral("SeriesStudio")) {
|
||||
return ItemFields::SeriesStudio;
|
||||
}
|
||||
if (str == QStringLiteral("SortName")) {
|
||||
return ItemFields::SortName;
|
||||
}
|
||||
if (str == QStringLiteral("SpecialEpisodeNumbers")) {
|
||||
return ItemFields::SpecialEpisodeNumbers;
|
||||
}
|
||||
if (str == QStringLiteral("Studios")) {
|
||||
return ItemFields::Studios;
|
||||
}
|
||||
if (str == QStringLiteral("BasicSyncInfo")) {
|
||||
return ItemFields::BasicSyncInfo;
|
||||
}
|
||||
if (str == QStringLiteral("SyncInfo")) {
|
||||
return ItemFields::SyncInfo;
|
||||
}
|
||||
if (str == QStringLiteral("Taglines")) {
|
||||
return ItemFields::Taglines;
|
||||
}
|
||||
if (str == QStringLiteral("Tags")) {
|
||||
return ItemFields::Tags;
|
||||
}
|
||||
if (str == QStringLiteral("RemoteTrailers")) {
|
||||
return ItemFields::RemoteTrailers;
|
||||
}
|
||||
if (str == QStringLiteral("MediaStreams")) {
|
||||
return ItemFields::MediaStreams;
|
||||
}
|
||||
if (str == QStringLiteral("SeasonUserData")) {
|
||||
return ItemFields::SeasonUserData;
|
||||
}
|
||||
if (str == QStringLiteral("ServiceName")) {
|
||||
return ItemFields::ServiceName;
|
||||
}
|
||||
if (str == QStringLiteral("ThemeSongIds")) {
|
||||
return ItemFields::ThemeSongIds;
|
||||
}
|
||||
if (str == QStringLiteral("ThemeVideoIds")) {
|
||||
return ItemFields::ThemeVideoIds;
|
||||
}
|
||||
if (str == QStringLiteral("ExternalEtag")) {
|
||||
return ItemFields::ExternalEtag;
|
||||
}
|
||||
if (str == QStringLiteral("PresentationUniqueKey")) {
|
||||
return ItemFields::PresentationUniqueKey;
|
||||
}
|
||||
if (str == QStringLiteral("InheritedParentalRatingValue")) {
|
||||
return ItemFields::InheritedParentalRatingValue;
|
||||
}
|
||||
if (str == QStringLiteral("ExternalSeriesId")) {
|
||||
return ItemFields::ExternalSeriesId;
|
||||
}
|
||||
if (str == QStringLiteral("SeriesPresentationUniqueKey")) {
|
||||
return ItemFields::SeriesPresentationUniqueKey;
|
||||
}
|
||||
if (str == QStringLiteral("DateLastRefreshed")) {
|
||||
return ItemFields::DateLastRefreshed;
|
||||
}
|
||||
if (str == QStringLiteral("DateLastSaved")) {
|
||||
return ItemFields::DateLastSaved;
|
||||
}
|
||||
if (str == QStringLiteral("RefreshState")) {
|
||||
return ItemFields::RefreshState;
|
||||
}
|
||||
if (str == QStringLiteral("ChannelImage")) {
|
||||
return ItemFields::ChannelImage;
|
||||
}
|
||||
if (str == QStringLiteral("EnableMediaSourceDisplay")) {
|
||||
return ItemFields::EnableMediaSourceDisplay;
|
||||
}
|
||||
if (str == QStringLiteral("Width")) {
|
||||
return ItemFields::Width;
|
||||
}
|
||||
if (str == QStringLiteral("Height")) {
|
||||
return ItemFields::Height;
|
||||
}
|
||||
if (str == QStringLiteral("ExtraIds")) {
|
||||
return ItemFields::ExtraIds;
|
||||
}
|
||||
if (str == QStringLiteral("LocalTrailerCount")) {
|
||||
return ItemFields::LocalTrailerCount;
|
||||
}
|
||||
if (str == QStringLiteral("IsHD")) {
|
||||
return ItemFields::IsHD;
|
||||
}
|
||||
if (str == QStringLiteral("SpecialFeatureCount")) {
|
||||
return ItemFields::SpecialFeatureCount;
|
||||
}
|
||||
|
||||
return ItemFields::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,48 @@ namespace DTO {
|
|||
|
||||
ItemFilterClass::ItemFilterClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using ItemFilter = Jellyfin::DTO::ItemFilter;
|
||||
|
||||
template <>
|
||||
ItemFilter fromJsonValue<ItemFilter>(const QJsonValue &source) {
|
||||
if (!source.isString()) return ItemFilter::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("IsFolder")) {
|
||||
return ItemFilter::IsFolder;
|
||||
}
|
||||
if (str == QStringLiteral("IsNotFolder")) {
|
||||
return ItemFilter::IsNotFolder;
|
||||
}
|
||||
if (str == QStringLiteral("IsUnplayed")) {
|
||||
return ItemFilter::IsUnplayed;
|
||||
}
|
||||
if (str == QStringLiteral("IsPlayed")) {
|
||||
return ItemFilter::IsPlayed;
|
||||
}
|
||||
if (str == QStringLiteral("IsFavorite")) {
|
||||
return ItemFilter::IsFavorite;
|
||||
}
|
||||
if (str == QStringLiteral("IsResumable")) {
|
||||
return ItemFilter::IsResumable;
|
||||
}
|
||||
if (str == QStringLiteral("Likes")) {
|
||||
return ItemFilter::Likes;
|
||||
}
|
||||
if (str == QStringLiteral("Dislikes")) {
|
||||
return ItemFilter::Dislikes;
|
||||
}
|
||||
if (str == QStringLiteral("IsFavoriteOrLikes")) {
|
||||
return ItemFilter::IsFavoriteOrLikes;
|
||||
}
|
||||
|
||||
return ItemFilter::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -32,22 +32,23 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
JoinGroupRequestDto::JoinGroupRequestDto(QObject *parent) {}
|
||||
JoinGroupRequestDto::JoinGroupRequestDto() {}
|
||||
|
||||
JoinGroupRequestDto JoinGroupRequestDto::fromJson(QJsonObject source) {JoinGroupRequestDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
JoinGroupRequestDto JoinGroupRequestDto::fromJson(QJsonObject source) {
|
||||
JoinGroupRequestDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void JoinGroupRequestDto::setFromJson(QJsonObject source) {
|
||||
m_groupId = fromJsonValue<QUuid>(source["GroupId"]);
|
||||
m_groupId = Jellyfin::Support::fromJsonValue<QUuid>(source["GroupId"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject JoinGroupRequestDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["GroupId"] = toJsonValue<QUuid>(m_groupId);
|
||||
result["GroupId"] = Jellyfin::Support::toJsonValue<QUuid>(m_groupId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -58,6 +59,17 @@ void JoinGroupRequestDto::setGroupId(QUuid newGroupId) {
|
|||
m_groupId = newGroupId;
|
||||
}
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using JoinGroupRequestDto = Jellyfin::DTO::JoinGroupRequestDto;
|
||||
|
||||
template <>
|
||||
JoinGroupRequestDto fromJsonValue<JoinGroupRequestDto>(const QJsonValue &source) {
|
||||
if (!source.isObject()) throw new ParseException("Expected JSON Object");
|
||||
return JoinGroupRequestDto::fromJson(source.toObject());
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
|
@ -34,5 +34,33 @@ namespace DTO {
|
|||
|
||||
KeepUntilClass::KeepUntilClass() {}
|
||||
|
||||
|
||||
} // NS DTO
|
||||
|
||||
namespace Support {
|
||||
|
||||
using KeepUntil = Jellyfin::DTO::KeepUntil;
|
||||
|
||||
template <>
|
||||
KeepUntil fromJsonValue<KeepUntil>(const QJsonValue &source) {
|
||||
if (!source.isString()) return KeepUntil::EnumNotSet;
|
||||
|
||||
QString str = source.toString();
|
||||
if (str == QStringLiteral("UntilDeleted")) {
|
||||
return KeepUntil::UntilDeleted;
|
||||
}
|
||||
if (str == QStringLiteral("UntilSpaceNeeded")) {
|
||||
return KeepUntil::UntilSpaceNeeded;
|
||||
}
|
||||
if (str == QStringLiteral("UntilWatched")) {
|
||||
return KeepUntil::UntilWatched;
|
||||
}
|
||||
if (str == QStringLiteral("UntilDate")) {
|
||||
return KeepUntil::UntilDate;
|
||||
}
|
||||
|
||||
return KeepUntil::EnumNotSet;
|
||||
}
|
||||
|
||||
} // NS Jellyfin
|
||||
} // NS DTO
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue