1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 01:05:17 +00:00

Fix sending of DeviceProfileInfo

Due to some errors within DeviceProfile and how nullables were
serialized, an invalid request was made and the
/Sessions/Capabilities/Full would give an 400 response back.

Besides that, ApiClient would generate a DeviceProfile before all
properties from QML were read. This has been fixed by implementing
QQmlParserStatus and only generating the device profile after all
properties are set.
This commit is contained in:
Henk Kalkwater 2021-09-08 23:20:12 +02:00
parent 8a9cb73686
commit 357ac89330
No known key found for this signature in database
GPG key ID: A69C050E9FD9FF6A
198 changed files with 5889 additions and 1761 deletions

View file

@ -45,8 +45,17 @@ QJsonObject {{className}}::toJson() const {
QJsonObject result;
{{#each properties as |property|}}
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
{{#if property.isNullable}}
if (!({{property.nullableCheck}})) {
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
}
{{#else}}
result["{{property.originalName}}"] = {{supportNamespace}}::toJsonValue<{{property.typeNameWithQualifiers}}>({{property.memberName}});
{{/if}}
{{/each}}
return result;

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <QHostInfo>
#include <QObject>
#include <QQmlListProperty>
#include <QQmlParserStatus>
#include <QScopedPointer>
#include <QString>
#include <QSysInfo>
@ -85,10 +86,11 @@ class ApiClientPrivate;
*
* These steps might change. I'm considering decoupling CredentialsManager from this class to clean some code up.
*/
class ApiClient : public QObject {
class ApiClient : public QObject, public QQmlParserStatus {
friend class WebSocket;
friend class PlaybackManager;
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_DECLARE_PRIVATE(ApiClient);
public:
explicit ApiClient(QObject *parent = nullptr);
@ -240,6 +242,9 @@ protected slots:
void credManagerUsersListed(const QString &server, QStringList users);
void credManagerTokenRetrieved(const QString &server, const QString &user, const QString &token);
void classBegin() override;
void componentComplete() override;
protected:
/**
* @brief Adds default headers to each request, like authentication headers etc.

View file

@ -686,21 +686,30 @@ MetaTypeInfo getType(ref const string name, const ref Node node, const ref Node
info.needsLocalImport = true;
info.typeName = type;
if (type in allSchemas) {
if ("type" in allSchemas[type]
&& allSchemas[type]["type"].as!string == "object") {
if ("enum" in allSchemas[type]) {
info.isTypeNullable = true;
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
} else if ("type" in allSchemas[type]
&& allSchemas[type]["type"].as!string == "object") {
writefln("Type %s is an object", type);
info.needsPointer = true;
info.isTypeNullable = true;
info.typeNullableCheck = ".isNull()";
info.typeNullableSetter = ".clear()";
} else if ("enum" in allSchemas[type]) {
info.isTypeNullable = true;
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
}
}
return info;
}
// Type is an enumeration
if ("enum" in node) {
info.isTypeNullable = true;
info.typeNullableCheck = "== " ~ info.typeName ~ "::EnumNotSet";
info.typeNullableSetter = "= " ~ info.typeName ~ "::EnumNotSet";
return info;
}
// No type information specified. As a fallback, use a QVariant.
if (!("type" in node)) {
info.typeName = "QVariant";

View file

@ -51,7 +51,7 @@ public:
bool online = true;
QSharedPointer<DTO::DeviceProfile> deviceProfile;
QSharedPointer<DTO::ClientCapabilitiesDto> clientCapabilities;
QVariantList supportedCommands;
QList<DTO::GeneralCommandType> supportedCommands;
bool authenticated = false;
@ -60,6 +60,8 @@ public:
*/
QUuid retrieveDeviceId() const;
bool componentBeingParsed = false;
};
ApiClient::ApiClient(QObject *parent)
@ -73,7 +75,6 @@ ApiClient::ApiClient(QObject *parent)
connect(d->credManager, &CredentialsManager::serversListed, this, &ApiClient::credManagerServersListed);
connect(d->credManager, &CredentialsManager::usersListed, this, &ApiClient::credManagerUsersListed);
connect(d->credManager, &CredentialsManager::tokenRetrieved, this, &ApiClient::credManagerTokenRetrieved);
generateDeviceProfile();
connect(d->settings, &ViewModel::Settings::maxStreamingBitRateChanged, this, [d](qint32 newBitrate){
d->deviceProfile->setMaxStreamingBitrate(newBitrate);
});
@ -148,13 +149,29 @@ ViewModel::Settings *ApiClient::settings() const {
QVariantList ApiClient::supportedCommands() const {
Q_D(const ApiClient);
return d->supportedCommands;
QVariantList result;
result.reserve(d->supportedCommands.size());
for(auto it = d->supportedCommands.begin(); it != d->supportedCommands.end(); it++) {
result.append(QVariant::fromValue<DTO::GeneralCommandType>(*it));
}
return result;
}
void ApiClient::setSupportedCommands(QVariantList newSupportedCommands) {
Q_D(ApiClient);
d->supportedCommands = newSupportedCommands;
d->supportedCommands.clear();
d->supportedCommands.reserve(newSupportedCommands.size());
for (int i = 0; i < newSupportedCommands.size(); i++) {
if (newSupportedCommands[i].canConvert<DTO::GeneralCommandType>()) {
d->supportedCommands.append(newSupportedCommands[i].value<DTO::GeneralCommandType>());
}
}
qDebug() << "Supported commands changed: " << d->supportedCommands;
emit supportedCommandsChanged();
if (!d->componentBeingParsed) {
this->generateDeviceProfile();
}
}
QSharedPointer<DTO::DeviceProfile> ApiClient::deviceProfile() const {
Q_D(const ApiClient);
@ -169,6 +186,22 @@ const QJsonObject ApiClient::clientCapabilities() const {
Q_D(const ApiClient);
return d->clientCapabilities->toJson();
}
// QQMLParserStatus implementation
void ApiClient::classBegin() {
Q_D(ApiClient);
d->componentBeingParsed = true;
}
void ApiClient::componentComplete() {
Q_D(ApiClient);
d->componentBeingParsed = false;
// Generate the device profile after all properties have been parsed.
generateDeviceProfile();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// BASE HTTP METHODS //
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -397,18 +430,10 @@ void ApiClient::generateDeviceProfile() {
deviceProfile->setMaxStreamingBitrate(d->settings->maxStreamingBitRate());
d->deviceProfile = deviceProfile;
QList<DTO::GeneralCommandType> supportedCommands;
supportedCommands.reserve(d->supportedCommands.size());
for (int i = 0; i < d->supportedCommands.size(); i++) {
if (d->supportedCommands[i].canConvert<DTO::GeneralCommandType>()) {
supportedCommands.append(d->supportedCommands[i].value<DTO::GeneralCommandType>());
}
}
QSharedPointer<DTO::ClientCapabilitiesDto> clientCapabilities = QSharedPointer<DTO::ClientCapabilitiesDto>::create();
clientCapabilities->setPlayableMediaTypes({"Audio", "Video", "Photo"});
clientCapabilities->setDeviceProfile(deviceProfile);
clientCapabilities->setSupportedCommands(supportedCommands);
clientCapabilities->setSupportedCommands(d->supportedCommands);
clientCapabilities->setAppStoreUrl("https://chris.netsoj.nl/projects/harbour-sailfin");
clientCapabilities->setIconUrl("https://chris.netsoj.nl/static/img/logo.png");
clientCapabilities->setSupportsPersistentIdentifier(true);

View file

@ -69,12 +69,12 @@ void AccessSchedule::setFromJson(QJsonObject source) {
QJsonObject AccessSchedule::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<qint32>(m_jellyfinId);
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(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;
}

View file

@ -84,17 +84,41 @@ void ActivityLogEntry::setFromJson(QJsonObject source) {
QJsonObject ActivityLogEntry::toJson() const {
QJsonObject result;
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);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_overview.isNull())) {
result["Overview"] = Jellyfin::Support::toJsonValue<QString>(m_overview);
}
if (!(m_shortOverview.isNull())) {
result["ShortOverview"] = Jellyfin::Support::toJsonValue<QString>(m_shortOverview);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
if (!(m_itemId.isNull())) {
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
}
result["Date"] = Jellyfin::Support::toJsonValue<QDateTime>(m_date);
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_userPrimaryImageTag);
result["Severity"] = Jellyfin::Support::toJsonValue<LogLevel>(m_severity);
if (!(m_userPrimaryImageTag.isNull())) {
result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_userPrimaryImageTag);
}
result["Severity"] = Jellyfin::Support::toJsonValue<LogLevel>(m_severity);
return result;
}

View file

@ -63,10 +63,14 @@ void ActivityLogEntryQueryResult::setFromJson(QJsonObject source) {
QJsonObject ActivityLogEntryQueryResult::toJson() const {
QJsonObject result;
result["Items"] = Jellyfin::Support::toJsonValue<QList<ActivityLogEntry>>(m_items);
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<ActivityLogEntry>>(m_items);
}
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}

View file

@ -57,8 +57,8 @@ void AddVirtualFolderDto::setFromJson(QJsonObject source) {
QJsonObject AddVirtualFolderDto::toJson() const {
QJsonObject result;
result["LibraryOptions"] = Jellyfin::Support::toJsonValue<QSharedPointer<LibraryOptions>>(m_libraryOptions);
result["LibraryOptions"] = Jellyfin::Support::toJsonValue<QSharedPointer<LibraryOptions>>(m_libraryOptions);
return result;
}

View file

@ -93,19 +93,67 @@ void AlbumInfo::setFromJson(QJsonObject source) {
QJsonObject AlbumInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
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<SongInfo>>(m_songInfos);
if (!(m_albumArtists.size() == 0)) {
result["AlbumArtists"] = Jellyfin::Support::toJsonValue<QStringList>(m_albumArtists);
}
if (!(m_artistProviderIds.isEmpty())) {
result["ArtistProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_artistProviderIds);
}
if (!(m_songInfos.size() == 0)) {
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<SongInfo>>(m_songInfos);
}
return result;
}

View file

@ -66,11 +66,15 @@ void AlbumInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject AlbumInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<AlbumInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -63,10 +63,10 @@ void AllThemeMediaResult::setFromJson(QJsonObject source) {
QJsonObject AllThemeMediaResult::toJson() const {
QJsonObject result;
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;
}

View file

@ -87,17 +87,57 @@ void ArtistInfo::setFromJson(QJsonObject source) {
QJsonObject ArtistInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<SongInfo>>(m_songInfos);
if (!(m_songInfos.size() == 0)) {
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<SongInfo>>(m_songInfos);
}
return result;
}

View file

@ -66,11 +66,15 @@ void ArtistInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject ArtistInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<ArtistInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -63,9 +63,21 @@ void AuthenticateUserByName::setFromJson(QJsonObject source) {
QJsonObject AuthenticateUserByName::toJson() const {
QJsonObject result;
result["Username"] = Jellyfin::Support::toJsonValue<QString>(m_username);
result["Pw"] = Jellyfin::Support::toJsonValue<QString>(m_pw);
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
if (!(m_username.isNull())) {
result["Username"] = Jellyfin::Support::toJsonValue<QString>(m_username);
}
if (!(m_pw.isNull())) {
result["Pw"] = Jellyfin::Support::toJsonValue<QString>(m_pw);
}
if (!(m_password.isNull())) {
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
}
return result;
}

View file

@ -90,18 +90,46 @@ void AuthenticationInfo::setFromJson(QJsonObject source) {
QJsonObject AuthenticationInfo::toJson() const {
QJsonObject result;
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);
if (!(m_accessToken.isNull())) {
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
}
if (!(m_deviceId.isNull())) {
result["DeviceId"] = Jellyfin::Support::toJsonValue<QString>(m_deviceId);
}
if (!(m_appName.isNull())) {
result["AppName"] = Jellyfin::Support::toJsonValue<QString>(m_appName);
}
if (!(m_appVersion.isNull())) {
result["AppVersion"] = Jellyfin::Support::toJsonValue<QString>(m_appVersion);
}
if (!(m_deviceName.isNull())) {
result["DeviceName"] = Jellyfin::Support::toJsonValue<QString>(m_deviceName);
}
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(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);
if (!(m_dateRevoked.isNull())) {
result["DateRevoked"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateRevoked);
}
result["DateLastActivity"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastActivity);
result["UserName"] = Jellyfin::Support::toJsonValue<QString>(m_userName);
if (!(m_userName.isNull())) {
result["UserName"] = Jellyfin::Support::toJsonValue<QString>(m_userName);
}
return result;
}

View file

@ -63,10 +63,14 @@ void AuthenticationInfoQueryResult::setFromJson(QJsonObject source) {
QJsonObject AuthenticationInfoQueryResult::toJson() const {
QJsonObject result;
result["Items"] = Jellyfin::Support::toJsonValue<QList<AuthenticationInfo>>(m_items);
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<AuthenticationInfo>>(m_items);
}
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}

View file

@ -66,10 +66,18 @@ void AuthenticationResult::setFromJson(QJsonObject source) {
QJsonObject AuthenticationResult::toJson() const {
QJsonObject result;
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);
if (!(m_accessToken.isNull())) {
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
}
if (!(m_serverId.isNull())) {
result["ServerId"] = Jellyfin::Support::toJsonValue<QString>(m_serverId);
}
return result;
}

View file

@ -87,18 +87,38 @@ void BaseItem::setFromJson(QJsonObject source) {
QJsonObject BaseItem::toJson() const {
QJsonObject result;
result["Size"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_size);
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
if (!(!m_size.has_value())) {
result["Size"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_size);
}
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
result["DateLastSaved"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastSaved);
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<MediaUrl>>(m_remoteTrailers);
if (!(m_remoteTrailers.size() == 0)) {
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<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);
if (!(m_shortcutPath.isNull())) {
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<QStringList>(m_extraIds);
result["SupportsExternalTransfer"] = Jellyfin::Support::toJsonValue<bool>(m_supportsExternalTransfer);
if (!(m_extraIds.size() == 0)) {
result["ExtraIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_extraIds);
}
result["SupportsExternalTransfer"] = Jellyfin::Support::toJsonValue<bool>(m_supportsExternalTransfer);
return result;
}

View file

@ -507,158 +507,718 @@ void BaseItemDto::setFromJson(QJsonObject source) {
QJsonObject BaseItemDto::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
result["ServerId"] = Jellyfin::Support::toJsonValue<QString>(m_serverId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_originalTitle.isNull())) {
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
}
if (!(m_serverId.isNull())) {
result["ServerId"] = Jellyfin::Support::toJsonValue<QString>(m_serverId);
}
result["Id"] = Jellyfin::Support::toJsonValue<QString>(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<std::optional<qint32>>(m_airsBeforeSeasonNumber);
result["AirsAfterSeasonNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsAfterSeasonNumber);
result["AirsBeforeEpisodeNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsBeforeEpisodeNumber);
result["CanDelete"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_canDelete);
result["CanDownload"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_canDownload);
result["HasSubtitles"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasSubtitles);
result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataLanguage);
result["PreferredMetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataCountryCode);
result["SupportsSync"] = Jellyfin::Support::toJsonValue<std::optional<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);
if (!(m_etag.isNull())) {
result["Etag"] = Jellyfin::Support::toJsonValue<QString>(m_etag);
}
if (!(m_sourceType.isNull())) {
result["SourceType"] = Jellyfin::Support::toJsonValue<QString>(m_sourceType);
}
if (!(m_playlistItemId.isNull())) {
result["PlaylistItemId"] = Jellyfin::Support::toJsonValue<QString>(m_playlistItemId);
}
if (!(m_dateCreated.isNull())) {
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
}
if (!(m_dateLastMediaAdded.isNull())) {
result["DateLastMediaAdded"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastMediaAdded);
}
if (!(m_extraType.isNull())) {
result["ExtraType"] = Jellyfin::Support::toJsonValue<QString>(m_extraType);
}
if (!(!m_airsBeforeSeasonNumber.has_value())) {
result["AirsBeforeSeasonNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsBeforeSeasonNumber);
}
if (!(!m_airsAfterSeasonNumber.has_value())) {
result["AirsAfterSeasonNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsAfterSeasonNumber);
}
if (!(!m_airsBeforeEpisodeNumber.has_value())) {
result["AirsBeforeEpisodeNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsBeforeEpisodeNumber);
}
if (!(!m_canDelete.has_value())) {
result["CanDelete"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_canDelete);
}
if (!(!m_canDownload.has_value())) {
result["CanDownload"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_canDownload);
}
if (!(!m_hasSubtitles.has_value())) {
result["HasSubtitles"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasSubtitles);
}
if (!(m_preferredMetadataLanguage.isNull())) {
result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataLanguage);
}
if (!(m_preferredMetadataCountryCode.isNull())) {
result["PreferredMetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataCountryCode);
}
if (!(!m_supportsSync.has_value())) {
result["SupportsSync"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_supportsSync);
}
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
if (!(m_sortName.isNull())) {
result["SortName"] = Jellyfin::Support::toJsonValue<QString>(m_sortName);
}
if (!(m_forcedSortName.isNull())) {
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<ExternalUrl>>(m_externalUrls);
result["MediaSources"] = Jellyfin::Support::toJsonValue<QList<MediaSourceInfo>>(m_mediaSources);
result["CriticRating"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_criticRating);
result["ProductionLocations"] = Jellyfin::Support::toJsonValue<QStringList>(m_productionLocations);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["EnableMediaSourceDisplay"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableMediaSourceDisplay);
result["OfficialRating"] = Jellyfin::Support::toJsonValue<QString>(m_officialRating);
result["CustomRating"] = Jellyfin::Support::toJsonValue<QString>(m_customRating);
result["ChannelId"] = Jellyfin::Support::toJsonValue<QString>(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<std::optional<float>>(m_communityRating);
result["CumulativeRunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_cumulativeRunTimeTicks);
result["RunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_runTimeTicks);
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
if (!(m_externalUrls.size() == 0)) {
result["ExternalUrls"] = Jellyfin::Support::toJsonValue<QList<ExternalUrl>>(m_externalUrls);
}
if (!(m_mediaSources.size() == 0)) {
result["MediaSources"] = Jellyfin::Support::toJsonValue<QList<MediaSourceInfo>>(m_mediaSources);
}
if (!(!m_criticRating.has_value())) {
result["CriticRating"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_criticRating);
}
if (!(m_productionLocations.size() == 0)) {
result["ProductionLocations"] = Jellyfin::Support::toJsonValue<QStringList>(m_productionLocations);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(!m_enableMediaSourceDisplay.has_value())) {
result["EnableMediaSourceDisplay"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableMediaSourceDisplay);
}
if (!(m_officialRating.isNull())) {
result["OfficialRating"] = Jellyfin::Support::toJsonValue<QString>(m_officialRating);
}
if (!(m_customRating.isNull())) {
result["CustomRating"] = Jellyfin::Support::toJsonValue<QString>(m_customRating);
}
if (!(m_channelId.isNull())) {
result["ChannelId"] = Jellyfin::Support::toJsonValue<QString>(m_channelId);
}
if (!(m_channelName.isNull())) {
result["ChannelName"] = Jellyfin::Support::toJsonValue<QString>(m_channelName);
}
if (!(m_overview.isNull())) {
result["Overview"] = Jellyfin::Support::toJsonValue<QString>(m_overview);
}
if (!(m_taglines.size() == 0)) {
result["Taglines"] = Jellyfin::Support::toJsonValue<QStringList>(m_taglines);
}
if (!(m_genres.size() == 0)) {
result["Genres"] = Jellyfin::Support::toJsonValue<QStringList>(m_genres);
}
if (!(!m_communityRating.has_value())) {
result["CommunityRating"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_communityRating);
}
if (!(!m_cumulativeRunTimeTicks.has_value())) {
result["CumulativeRunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_cumulativeRunTimeTicks);
}
if (!(!m_runTimeTicks.has_value())) {
result["RunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_runTimeTicks);
}
result["PlayAccess"] = Jellyfin::Support::toJsonValue<PlayAccess>(m_playAccess);
result["AspectRatio"] = Jellyfin::Support::toJsonValue<QString>(m_aspectRatio);
result["ProductionYear"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_productionYear);
result["IsPlaceHolder"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isPlaceHolder);
result["Number"] = Jellyfin::Support::toJsonValue<QString>(m_number);
result["ChannelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_channelNumber);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumberEnd);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<MediaUrl>>(m_remoteTrailers);
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
result["IsHD"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isHD);
result["IsFolder"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isFolder);
result["ParentId"] = Jellyfin::Support::toJsonValue<QString>(m_parentId);
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
result["People"] = Jellyfin::Support::toJsonValue<QList<BaseItemPerson>>(m_people);
result["Studios"] = Jellyfin::Support::toJsonValue<QList<NameGuidPair>>(m_studios);
result["GenreItems"] = Jellyfin::Support::toJsonValue<QList<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<std::optional<qint32>>(m_localTrailerCount);
if (!(m_aspectRatio.isNull())) {
result["AspectRatio"] = Jellyfin::Support::toJsonValue<QString>(m_aspectRatio);
}
if (!(!m_productionYear.has_value())) {
result["ProductionYear"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_productionYear);
}
if (!(!m_isPlaceHolder.has_value())) {
result["IsPlaceHolder"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isPlaceHolder);
}
if (!(m_number.isNull())) {
result["Number"] = Jellyfin::Support::toJsonValue<QString>(m_number);
}
if (!(m_channelNumber.isNull())) {
result["ChannelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_channelNumber);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_indexNumberEnd.has_value())) {
result["IndexNumberEnd"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumberEnd);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_remoteTrailers.size() == 0)) {
result["RemoteTrailers"] = Jellyfin::Support::toJsonValue<QList<MediaUrl>>(m_remoteTrailers);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_isHD.has_value())) {
result["IsHD"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isHD);
}
if (!(!m_isFolder.has_value())) {
result["IsFolder"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isFolder);
}
if (!(m_parentId.isNull())) {
result["ParentId"] = Jellyfin::Support::toJsonValue<QString>(m_parentId);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
if (!(m_people.size() == 0)) {
result["People"] = Jellyfin::Support::toJsonValue<QList<BaseItemPerson>>(m_people);
}
if (!(m_studios.size() == 0)) {
result["Studios"] = Jellyfin::Support::toJsonValue<QList<NameGuidPair>>(m_studios);
}
if (!(m_genreItems.size() == 0)) {
result["GenreItems"] = Jellyfin::Support::toJsonValue<QList<NameGuidPair>>(m_genreItems);
}
if (!(m_parentLogoItemId.isNull())) {
result["ParentLogoItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentLogoItemId);
}
if (!(m_parentBackdropItemId.isNull())) {
result["ParentBackdropItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentBackdropItemId);
}
if (!(m_parentBackdropImageTags.size() == 0)) {
result["ParentBackdropImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_parentBackdropImageTags);
}
if (!(!m_localTrailerCount.has_value())) {
result["LocalTrailerCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_localTrailerCount);
}
result["UserData"] = Jellyfin::Support::toJsonValue<QSharedPointer<UserItemDataDto>>(m_userData);
result["RecursiveItemCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_recursiveItemCount);
result["ChildCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_childCount);
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
result["SeriesId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesId);
result["SeasonId"] = Jellyfin::Support::toJsonValue<QString>(m_seasonId);
result["SpecialFeatureCount"] = Jellyfin::Support::toJsonValue<std::optional<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<std::optional<double>>(m_primaryImageAspectRatio);
result["Artists"] = Jellyfin::Support::toJsonValue<QStringList>(m_artists);
result["ArtistItems"] = Jellyfin::Support::toJsonValue<QList<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<QString>(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<NameGuidPair>>(m_albumArtists);
result["SeasonName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonName);
result["MediaStreams"] = Jellyfin::Support::toJsonValue<QList<MediaStream>>(m_mediaStreams);
if (!(!m_recursiveItemCount.has_value())) {
result["RecursiveItemCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_recursiveItemCount);
}
if (!(!m_childCount.has_value())) {
result["ChildCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_childCount);
}
if (!(m_seriesName.isNull())) {
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
}
if (!(m_seriesId.isNull())) {
result["SeriesId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesId);
}
if (!(m_seasonId.isNull())) {
result["SeasonId"] = Jellyfin::Support::toJsonValue<QString>(m_seasonId);
}
if (!(!m_specialFeatureCount.has_value())) {
result["SpecialFeatureCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_specialFeatureCount);
}
if (!(m_displayPreferencesId.isNull())) {
result["DisplayPreferencesId"] = Jellyfin::Support::toJsonValue<QString>(m_displayPreferencesId);
}
if (!(m_status.isNull())) {
result["Status"] = Jellyfin::Support::toJsonValue<QString>(m_status);
}
if (!(m_airTime.isNull())) {
result["AirTime"] = Jellyfin::Support::toJsonValue<QString>(m_airTime);
}
if (!(m_airDays.size() == 0)) {
result["AirDays"] = Jellyfin::Support::toJsonValue<QList<DayOfWeek>>(m_airDays);
}
if (!(m_tags.size() == 0)) {
result["Tags"] = Jellyfin::Support::toJsonValue<QStringList>(m_tags);
}
if (!(!m_primaryImageAspectRatio.has_value())) {
result["PrimaryImageAspectRatio"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_primaryImageAspectRatio);
}
if (!(m_artists.size() == 0)) {
result["Artists"] = Jellyfin::Support::toJsonValue<QStringList>(m_artists);
}
if (!(m_artistItems.size() == 0)) {
result["ArtistItems"] = Jellyfin::Support::toJsonValue<QList<NameGuidPair>>(m_artistItems);
}
if (!(m_album.isNull())) {
result["Album"] = Jellyfin::Support::toJsonValue<QString>(m_album);
}
if (!(m_collectionType.isNull())) {
result["CollectionType"] = Jellyfin::Support::toJsonValue<QString>(m_collectionType);
}
if (!(m_displayOrder.isNull())) {
result["DisplayOrder"] = Jellyfin::Support::toJsonValue<QString>(m_displayOrder);
}
if (!(m_albumId.isNull())) {
result["AlbumId"] = Jellyfin::Support::toJsonValue<QString>(m_albumId);
}
if (!(m_albumPrimaryImageTag.isNull())) {
result["AlbumPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_albumPrimaryImageTag);
}
if (!(m_seriesPrimaryImageTag.isNull())) {
result["SeriesPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_seriesPrimaryImageTag);
}
if (!(m_albumArtist.isNull())) {
result["AlbumArtist"] = Jellyfin::Support::toJsonValue<QString>(m_albumArtist);
}
if (!(m_albumArtists.size() == 0)) {
result["AlbumArtists"] = Jellyfin::Support::toJsonValue<QList<NameGuidPair>>(m_albumArtists);
}
if (!(m_seasonName.isNull())) {
result["SeasonName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonName);
}
if (!(m_mediaStreams.size() == 0)) {
result["MediaStreams"] = Jellyfin::Support::toJsonValue<QList<MediaStream>>(m_mediaStreams);
}
result["VideoType"] = Jellyfin::Support::toJsonValue<VideoType>(m_videoType);
result["PartCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_partCount);
result["MediaSourceCount"] = Jellyfin::Support::toJsonValue<std::optional<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<ChapterInfo>>(m_chapters);
if (!(!m_partCount.has_value())) {
result["PartCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_partCount);
}
if (!(!m_mediaSourceCount.has_value())) {
result["MediaSourceCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_mediaSourceCount);
}
if (!(m_imageTags.isEmpty())) {
result["ImageTags"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageTags);
}
if (!(m_backdropImageTags.size() == 0)) {
result["BackdropImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_backdropImageTags);
}
if (!(m_screenshotImageTags.size() == 0)) {
result["ScreenshotImageTags"] = Jellyfin::Support::toJsonValue<QStringList>(m_screenshotImageTags);
}
if (!(m_parentLogoImageTag.isNull())) {
result["ParentLogoImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentLogoImageTag);
}
if (!(m_parentArtItemId.isNull())) {
result["ParentArtItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentArtItemId);
}
if (!(m_parentArtImageTag.isNull())) {
result["ParentArtImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentArtImageTag);
}
if (!(m_seriesThumbImageTag.isNull())) {
result["SeriesThumbImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_seriesThumbImageTag);
}
if (!(m_imageBlurHashes.isEmpty())) {
result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageBlurHashes);
}
if (!(m_seriesStudio.isNull())) {
result["SeriesStudio"] = Jellyfin::Support::toJsonValue<QString>(m_seriesStudio);
}
if (!(m_parentThumbItemId.isNull())) {
result["ParentThumbItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentThumbItemId);
}
if (!(m_parentThumbImageTag.isNull())) {
result["ParentThumbImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentThumbImageTag);
}
if (!(m_parentPrimaryImageItemId.isNull())) {
result["ParentPrimaryImageItemId"] = Jellyfin::Support::toJsonValue<QString>(m_parentPrimaryImageItemId);
}
if (!(m_parentPrimaryImageTag.isNull())) {
result["ParentPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_parentPrimaryImageTag);
}
if (!(m_chapters.size() == 0)) {
result["Chapters"] = Jellyfin::Support::toJsonValue<QList<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<std::optional<qint32>>(m_trailerCount);
result["MovieCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_movieCount);
result["SeriesCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_seriesCount);
result["ProgramCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_programCount);
result["EpisodeCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_episodeCount);
result["SongCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_songCount);
result["AlbumCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_albumCount);
result["ArtistCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_artistCount);
result["MusicVideoCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_musicVideoCount);
result["LockData"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_lockData);
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<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<std::optional<double>>(m_exposureTime);
result["FocalLength"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_focalLength);
if (!(m_mediaType.isNull())) {
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
}
if (!(m_endDate.isNull())) {
result["EndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_endDate);
}
if (!(m_lockedFields.size() == 0)) {
result["LockedFields"] = Jellyfin::Support::toJsonValue<QList<MetadataField>>(m_lockedFields);
}
if (!(!m_trailerCount.has_value())) {
result["TrailerCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_trailerCount);
}
if (!(!m_movieCount.has_value())) {
result["MovieCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_movieCount);
}
if (!(!m_seriesCount.has_value())) {
result["SeriesCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_seriesCount);
}
if (!(!m_programCount.has_value())) {
result["ProgramCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_programCount);
}
if (!(!m_episodeCount.has_value())) {
result["EpisodeCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_episodeCount);
}
if (!(!m_songCount.has_value())) {
result["SongCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_songCount);
}
if (!(!m_albumCount.has_value())) {
result["AlbumCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_albumCount);
}
if (!(!m_artistCount.has_value())) {
result["ArtistCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_artistCount);
}
if (!(!m_musicVideoCount.has_value())) {
result["MusicVideoCount"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_musicVideoCount);
}
if (!(!m_lockData.has_value())) {
result["LockData"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_lockData);
}
if (!(!m_width.has_value())) {
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
}
if (!(!m_height.has_value())) {
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_height);
}
if (!(m_cameraMake.isNull())) {
result["CameraMake"] = Jellyfin::Support::toJsonValue<QString>(m_cameraMake);
}
if (!(m_cameraModel.isNull())) {
result["CameraModel"] = Jellyfin::Support::toJsonValue<QString>(m_cameraModel);
}
if (!(m_software.isNull())) {
result["Software"] = Jellyfin::Support::toJsonValue<QString>(m_software);
}
if (!(!m_exposureTime.has_value())) {
result["ExposureTime"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_exposureTime);
}
if (!(!m_focalLength.has_value())) {
result["FocalLength"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_focalLength);
}
result["ImageOrientation"] = Jellyfin::Support::toJsonValue<ImageOrientation>(m_imageOrientation);
result["Aperture"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_aperture);
result["ShutterSpeed"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_shutterSpeed);
result["Latitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_latitude);
result["Longitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_longitude);
result["Altitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_altitude);
result["IsoSpeedRating"] = Jellyfin::Support::toJsonValue<std::optional<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<std::optional<double>>(m_completionPercentage);
result["IsRepeat"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isRepeat);
result["EpisodeTitle"] = Jellyfin::Support::toJsonValue<QString>(m_episodeTitle);
if (!(!m_aperture.has_value())) {
result["Aperture"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_aperture);
}
if (!(!m_shutterSpeed.has_value())) {
result["ShutterSpeed"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_shutterSpeed);
}
if (!(!m_latitude.has_value())) {
result["Latitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_latitude);
}
if (!(!m_longitude.has_value())) {
result["Longitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_longitude);
}
if (!(!m_altitude.has_value())) {
result["Altitude"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_altitude);
}
if (!(!m_isoSpeedRating.has_value())) {
result["IsoSpeedRating"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_isoSpeedRating);
}
if (!(m_seriesTimerId.isNull())) {
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
}
if (!(m_programId.isNull())) {
result["ProgramId"] = Jellyfin::Support::toJsonValue<QString>(m_programId);
}
if (!(m_channelPrimaryImageTag.isNull())) {
result["ChannelPrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_channelPrimaryImageTag);
}
if (!(m_startDate.isNull())) {
result["StartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_startDate);
}
if (!(!m_completionPercentage.has_value())) {
result["CompletionPercentage"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_completionPercentage);
}
if (!(!m_isRepeat.has_value())) {
result["IsRepeat"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isRepeat);
}
if (!(m_episodeTitle.isNull())) {
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<std::optional<bool>>(m_isMovie);
result["IsSports"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSports);
result["IsSeries"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSeries);
result["IsLive"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isLive);
result["IsNews"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isNews);
result["IsKids"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isKids);
result["IsPremiere"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isPremiere);
result["TimerId"] = Jellyfin::Support::toJsonValue<QString>(m_timerId);
result["CurrentProgram"] = Jellyfin::Support::toJsonValue<QSharedPointer<BaseItemDto>>(m_currentProgram);
if (!(!m_isMovie.has_value())) {
result["IsMovie"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isMovie);
}
if (!(!m_isSports.has_value())) {
result["IsSports"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSports);
}
if (!(!m_isSeries.has_value())) {
result["IsSeries"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSeries);
}
if (!(!m_isLive.has_value())) {
result["IsLive"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isLive);
}
if (!(!m_isNews.has_value())) {
result["IsNews"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isNews);
}
if (!(!m_isKids.has_value())) {
result["IsKids"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isKids);
}
if (!(!m_isPremiere.has_value())) {
result["IsPremiere"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isPremiere);
}
if (!(m_timerId.isNull())) {
result["TimerId"] = Jellyfin::Support::toJsonValue<QString>(m_timerId);
}
result["CurrentProgram"] = Jellyfin::Support::toJsonValue<QSharedPointer<BaseItemDto>>(m_currentProgram);
return result;
}

View file

@ -63,10 +63,14 @@ void BaseItemDtoQueryResult::setFromJson(QJsonObject source) {
QJsonObject BaseItemDtoQueryResult::toJson() const {
QJsonObject result;
result["Items"] = Jellyfin::Support::toJsonValue<QList<BaseItemDto>>(m_items);
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<BaseItemDto>>(m_items);
}
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}

View file

@ -72,12 +72,36 @@ void BaseItemPerson::setFromJson(QJsonObject source) {
QJsonObject BaseItemPerson::toJson() const {
QJsonObject result;
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);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_role.isNull())) {
result["Role"] = Jellyfin::Support::toJsonValue<QString>(m_role);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
if (!(m_primaryImageTag.isNull())) {
result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_primaryImageTag);
}
if (!(m_imageBlurHashes.isEmpty())) {
result["ImageBlurHashes"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_imageBlurHashes);
}
return result;
}

View file

@ -87,17 +87,57 @@ void BookInfo::setFromJson(QJsonObject source) {
QJsonObject BookInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
if (!(m_seriesName.isNull())) {
result["SeriesName"] = Jellyfin::Support::toJsonValue<QString>(m_seriesName);
}
return result;
}

View file

@ -66,11 +66,15 @@ void BookInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject BookInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<BookInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -84,17 +84,53 @@ void BoxSetInfo::setFromJson(QJsonObject source) {
QJsonObject BoxSetInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
return result;
}

View file

@ -66,11 +66,15 @@ void BoxSetInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject BoxSetInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<BoxSetInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -60,8 +60,16 @@ void BrandingOptions::setFromJson(QJsonObject source) {
QJsonObject BrandingOptions::toJson() const {
QJsonObject result;
result["LoginDisclaimer"] = Jellyfin::Support::toJsonValue<QString>(m_loginDisclaimer);
result["CustomCss"] = Jellyfin::Support::toJsonValue<QString>(m_customCss);
if (!(m_loginDisclaimer.isNull())) {
result["LoginDisclaimer"] = Jellyfin::Support::toJsonValue<QString>(m_loginDisclaimer);
}
if (!(m_customCss.isNull())) {
result["CustomCss"] = Jellyfin::Support::toJsonValue<QString>(m_customCss);
}
return result;
}

View file

@ -66,11 +66,11 @@ void BufferRequestDto::setFromJson(QJsonObject source) {
QJsonObject BufferRequestDto::toJson() const {
QJsonObject result;
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<QString>(m_playlistItemId);
return result;
}

View file

@ -90,19 +90,47 @@ void ChannelFeatures::setFromJson(QJsonObject source) {
QJsonObject ChannelFeatures::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
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<std::optional<qint32>>(m_maxPageSize);
result["AutoRefreshLevels"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_autoRefreshLevels);
result["DefaultSortFields"] = Jellyfin::Support::toJsonValue<QList<ChannelItemSortField>>(m_defaultSortFields);
if (!(m_mediaTypes.size() == 0)) {
result["MediaTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaType>>(m_mediaTypes);
}
if (!(m_contentTypes.size() == 0)) {
result["ContentTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaContentType>>(m_contentTypes);
}
if (!(!m_maxPageSize.has_value())) {
result["MaxPageSize"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxPageSize);
}
if (!(!m_autoRefreshLevels.has_value())) {
result["AutoRefreshLevels"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_autoRefreshLevels);
}
if (!(m_defaultSortFields.size() == 0)) {
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;
}

View file

@ -66,10 +66,26 @@ void ChannelMappingOptionsDto::setFromJson(QJsonObject source) {
QJsonObject ChannelMappingOptionsDto::toJson() const {
QJsonObject result;
result["TunerChannels"] = Jellyfin::Support::toJsonValue<QList<TunerChannelMapping>>(m_tunerChannels);
result["ProviderChannels"] = Jellyfin::Support::toJsonValue<QList<NameIdPair>>(m_providerChannels);
result["Mappings"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_mappings);
result["ProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_providerName);
if (!(m_tunerChannels.size() == 0)) {
result["TunerChannels"] = Jellyfin::Support::toJsonValue<QList<TunerChannelMapping>>(m_tunerChannels);
}
if (!(m_providerChannels.size() == 0)) {
result["ProviderChannels"] = Jellyfin::Support::toJsonValue<QList<NameIdPair>>(m_providerChannels);
}
if (!(m_mappings.size() == 0)) {
result["Mappings"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_mappings);
}
if (!(m_providerName.isNull())) {
result["ProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_providerName);
}
return result;
}

View file

@ -69,11 +69,23 @@ void ChapterInfo::setFromJson(QJsonObject source) {
QJsonObject ChapterInfo::toJson() const {
QJsonObject result;
result["StartPositionTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_startPositionTicks);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["ImagePath"] = Jellyfin::Support::toJsonValue<QString>(m_imagePath);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_imagePath.isNull())) {
result["ImagePath"] = Jellyfin::Support::toJsonValue<QString>(m_imagePath);
}
result["ImageDateModified"] = Jellyfin::Support::toJsonValue<QDateTime>(m_imageDateModified);
result["ImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_imageTag);
if (!(m_imageTag.isNull())) {
result["ImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_imageTag);
}
return result;
}

View file

@ -84,16 +84,36 @@ void ClientCapabilities::setFromJson(QJsonObject source) {
QJsonObject ClientCapabilities::toJson() const {
QJsonObject result;
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
result["SupportedCommands"] = Jellyfin::Support::toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
if (!(m_playableMediaTypes.size() == 0)) {
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
}
if (!(m_supportedCommands.size() == 0)) {
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);
if (!(m_messageCallbackUrl.isNull())) {
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);
if (!(m_appStoreUrl.isNull())) {
result["AppStoreUrl"] = Jellyfin::Support::toJsonValue<QString>(m_appStoreUrl);
}
if (!(m_iconUrl.isNull())) {
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
}
return result;
}

View file

@ -84,16 +84,36 @@ void ClientCapabilitiesDto::setFromJson(QJsonObject source) {
QJsonObject ClientCapabilitiesDto::toJson() const {
QJsonObject result;
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
result["SupportedCommands"] = Jellyfin::Support::toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
if (!(m_playableMediaTypes.size() == 0)) {
result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QStringList>(m_playableMediaTypes);
}
if (!(m_supportedCommands.size() == 0)) {
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);
if (!(m_messageCallbackUrl.isNull())) {
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);
if (!(m_appStoreUrl.isNull())) {
result["AppStoreUrl"] = Jellyfin::Support::toJsonValue<QString>(m_appStoreUrl);
}
if (!(m_iconUrl.isNull())) {
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
}
return result;
}

View file

@ -69,11 +69,27 @@ void CodecProfile::setFromJson(QJsonObject source) {
QJsonObject CodecProfile::toJson() const {
QJsonObject result;
result["Type"] = Jellyfin::Support::toJsonValue<CodecType>(m_type);
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
result["ApplyConditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_applyConditions);
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
if (!(m_conditions.size() == 0)) {
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
}
if (!(m_applyConditions.size() == 0)) {
result["ApplyConditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_applyConditions);
}
if (!(m_codec.isNull())) {
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
}
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
return result;
}

View file

@ -57,8 +57,8 @@ void CollectionCreationResult::setFromJson(QJsonObject source) {
QJsonObject CollectionCreationResult::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
return result;
}

View file

@ -75,13 +75,33 @@ void ConfigurationPageInfo::setFromJson(QJsonObject source) {
QJsonObject ConfigurationPageInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_name.isNull())) {
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);
if (!(m_menuSection.isNull())) {
result["MenuSection"] = Jellyfin::Support::toJsonValue<QString>(m_menuSection);
}
if (!(m_menuIcon.isNull())) {
result["MenuIcon"] = Jellyfin::Support::toJsonValue<QString>(m_menuIcon);
}
if (!(m_displayName.isNull())) {
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
}
result["ConfigurationPageType"] = Jellyfin::Support::toJsonValue<ConfigurationPageType>(m_configurationPageType);
result["PluginId"] = Jellyfin::Support::toJsonValue<QString>(m_pluginId);
if (!(m_pluginId.isNull())) {
result["PluginId"] = Jellyfin::Support::toJsonValue<QString>(m_pluginId);
}
return result;
}

View file

@ -63,9 +63,17 @@ void ContainerProfile::setFromJson(QJsonObject source) {
QJsonObject ContainerProfile::toJson() const {
QJsonObject result;
result["Type"] = Jellyfin::Support::toJsonValue<DlnaProfileType>(m_type);
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
if (!(m_conditions.size() == 0)) {
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
}
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
return result;
}

View file

@ -63,10 +63,18 @@ void ControlResponse::setFromJson(QJsonObject source) {
QJsonObject ControlResponse::toJson() const {
QJsonObject result;
result["Headers"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_headers);
result["Xml"] = Jellyfin::Support::toJsonValue<QString>(m_xml);
result["IsSuccessful"] = Jellyfin::Support::toJsonValue<bool>(m_isSuccessful);
if (!(m_headers.isEmpty())) {
result["Headers"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_headers);
}
if (!(m_xml.isNull())) {
result["Xml"] = Jellyfin::Support::toJsonValue<QString>(m_xml);
}
result["IsSuccessful"] = Jellyfin::Support::toJsonValue<bool>(m_isSuccessful);
return result;
}

View file

@ -66,10 +66,26 @@ void CountryInfo::setFromJson(QJsonObject source) {
QJsonObject CountryInfo::toJson() const {
QJsonObject result;
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);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_displayName.isNull())) {
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
}
if (!(m_twoLetterISORegionName.isNull())) {
result["TwoLetterISORegionName"] = Jellyfin::Support::toJsonValue<QString>(m_twoLetterISORegionName);
}
if (!(m_threeLetterISORegionName.isNull())) {
result["ThreeLetterISORegionName"] = Jellyfin::Support::toJsonValue<QString>(m_threeLetterISORegionName);
}
return result;
}

View file

@ -66,10 +66,26 @@ void CreatePlaylistDto::setFromJson(QJsonObject source) {
QJsonObject CreatePlaylistDto::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Ids"] = Jellyfin::Support::toJsonValue<QStringList>(m_ids);
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_ids.size() == 0)) {
result["Ids"] = Jellyfin::Support::toJsonValue<QStringList>(m_ids);
}
if (!(m_userId.isNull())) {
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
}
if (!(m_mediaType.isNull())) {
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
}
return result;
}

View file

@ -60,8 +60,16 @@ void CreateUserByName::setFromJson(QJsonObject source) {
QJsonObject CreateUserByName::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_password.isNull())) {
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
}
return result;
}

View file

@ -69,11 +69,31 @@ void CultureDto::setFromJson(QJsonObject source) {
QJsonObject CultureDto::toJson() const {
QJsonObject result;
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);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_displayName.isNull())) {
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
}
if (!(m_twoLetterISOLanguageName.isNull())) {
result["TwoLetterISOLanguageName"] = Jellyfin::Support::toJsonValue<QString>(m_twoLetterISOLanguageName);
}
if (!(m_threeLetterISOLanguageName.isNull())) {
result["ThreeLetterISOLanguageName"] = Jellyfin::Support::toJsonValue<QString>(m_threeLetterISOLanguageName);
}
if (!(m_threeLetterISOLanguageNames.size() == 0)) {
result["ThreeLetterISOLanguageNames"] = Jellyfin::Support::toJsonValue<QStringList>(m_threeLetterISOLanguageNames);
}
return result;
}

View file

@ -57,7 +57,11 @@ void DefaultDirectoryBrowserInfoDto::setFromJson(QJsonObject source) {
QJsonObject DefaultDirectoryBrowserInfoDto::toJson() const {
QJsonObject result;
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
return result;
}

View file

@ -81,15 +81,51 @@ void DeviceIdentification::setFromJson(QJsonObject source) {
QJsonObject DeviceIdentification::toJson() const {
QJsonObject result;
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<HttpHeaderInfo>>(m_headers);
if (!(m_friendlyName.isNull())) {
result["FriendlyName"] = Jellyfin::Support::toJsonValue<QString>(m_friendlyName);
}
if (!(m_modelNumber.isNull())) {
result["ModelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_modelNumber);
}
if (!(m_serialNumber.isNull())) {
result["SerialNumber"] = Jellyfin::Support::toJsonValue<QString>(m_serialNumber);
}
if (!(m_modelName.isNull())) {
result["ModelName"] = Jellyfin::Support::toJsonValue<QString>(m_modelName);
}
if (!(m_modelDescription.isNull())) {
result["ModelDescription"] = Jellyfin::Support::toJsonValue<QString>(m_modelDescription);
}
if (!(m_modelUrl.isNull())) {
result["ModelUrl"] = Jellyfin::Support::toJsonValue<QString>(m_modelUrl);
}
if (!(m_manufacturer.isNull())) {
result["Manufacturer"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturer);
}
if (!(m_manufacturerUrl.isNull())) {
result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturerUrl);
}
if (!(m_headers.size() == 0)) {
result["Headers"] = Jellyfin::Support::toJsonValue<QList<HttpHeaderInfo>>(m_headers);
}
return result;
}

View file

@ -81,15 +81,39 @@ void DeviceInfo::setFromJson(QJsonObject source) {
QJsonObject DeviceInfo::toJson() const {
QJsonObject result;
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);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_lastUserName.isNull())) {
result["LastUserName"] = Jellyfin::Support::toJsonValue<QString>(m_lastUserName);
}
if (!(m_appName.isNull())) {
result["AppName"] = Jellyfin::Support::toJsonValue<QString>(m_appName);
}
if (!(m_appVersion.isNull())) {
result["AppVersion"] = Jellyfin::Support::toJsonValue<QString>(m_appVersion);
}
result["LastUserId"] = Jellyfin::Support::toJsonValue<QString>(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);
if (!(m_iconUrl.isNull())) {
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
}
return result;
}

View file

@ -63,10 +63,14 @@ void DeviceInfoQueryResult::setFromJson(QJsonObject source) {
QJsonObject DeviceInfoQueryResult::toJson() const {
QJsonObject result;
result["Items"] = Jellyfin::Support::toJsonValue<QList<DeviceInfo>>(m_items);
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<DeviceInfo>>(m_items);
}
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}

View file

@ -57,7 +57,11 @@ void DeviceOptions::setFromJson(QJsonObject source) {
QJsonObject DeviceOptions::toJson() const {
QJsonObject result;
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
if (!(m_customName.isNull())) {
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
}
return result;
}

View file

@ -171,45 +171,157 @@ void DeviceProfile::setFromJson(QJsonObject source) {
QJsonObject DeviceProfile::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
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);
if (!(m_friendlyName.isNull())) {
result["FriendlyName"] = Jellyfin::Support::toJsonValue<QString>(m_friendlyName);
}
if (!(m_manufacturer.isNull())) {
result["Manufacturer"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturer);
}
if (!(m_manufacturerUrl.isNull())) {
result["ManufacturerUrl"] = Jellyfin::Support::toJsonValue<QString>(m_manufacturerUrl);
}
if (!(m_modelName.isNull())) {
result["ModelName"] = Jellyfin::Support::toJsonValue<QString>(m_modelName);
}
if (!(m_modelDescription.isNull())) {
result["ModelDescription"] = Jellyfin::Support::toJsonValue<QString>(m_modelDescription);
}
if (!(m_modelNumber.isNull())) {
result["ModelNumber"] = Jellyfin::Support::toJsonValue<QString>(m_modelNumber);
}
if (!(m_modelUrl.isNull())) {
result["ModelUrl"] = Jellyfin::Support::toJsonValue<QString>(m_modelUrl);
}
if (!(m_serialNumber.isNull())) {
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);
if (!(m_supportedMediaTypes.isNull())) {
result["SupportedMediaTypes"] = Jellyfin::Support::toJsonValue<QString>(m_supportedMediaTypes);
}
if (!(m_userId.isNull())) {
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
}
if (!(m_albumArtPn.isNull())) {
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<std::optional<qint32>>(m_maxIconWidth);
result["MaxIconHeight"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxIconHeight);
result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStreamingBitrate);
result["MaxStaticBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStaticBitrate);
result["MusicStreamingTranscodingBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_musicStreamingTranscodingBitrate);
result["MaxStaticMusicBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStaticMusicBitrate);
result["SonyAggregationFlags"] = Jellyfin::Support::toJsonValue<QString>(m_sonyAggregationFlags);
result["ProtocolInfo"] = Jellyfin::Support::toJsonValue<QString>(m_protocolInfo);
if (!(!m_maxIconWidth.has_value())) {
result["MaxIconWidth"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxIconWidth);
}
if (!(!m_maxIconHeight.has_value())) {
result["MaxIconHeight"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxIconHeight);
}
if (!(!m_maxStreamingBitrate.has_value())) {
result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStreamingBitrate);
}
if (!(!m_maxStaticBitrate.has_value())) {
result["MaxStaticBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStaticBitrate);
}
if (!(!m_musicStreamingTranscodingBitrate.has_value())) {
result["MusicStreamingTranscodingBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_musicStreamingTranscodingBitrate);
}
if (!(!m_maxStaticMusicBitrate.has_value())) {
result["MaxStaticMusicBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxStaticMusicBitrate);
}
if (!(m_sonyAggregationFlags.isNull())) {
result["SonyAggregationFlags"] = Jellyfin::Support::toJsonValue<QString>(m_sonyAggregationFlags);
}
if (!(m_protocolInfo.isNull())) {
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<XmlAttribute>>(m_xmlRootAttributes);
result["DirectPlayProfiles"] = Jellyfin::Support::toJsonValue<QList<DirectPlayProfile>>(m_directPlayProfiles);
result["TranscodingProfiles"] = Jellyfin::Support::toJsonValue<QList<TranscodingProfile>>(m_transcodingProfiles);
result["ContainerProfiles"] = Jellyfin::Support::toJsonValue<QList<ContainerProfile>>(m_containerProfiles);
result["CodecProfiles"] = Jellyfin::Support::toJsonValue<QList<CodecProfile>>(m_codecProfiles);
result["ResponseProfiles"] = Jellyfin::Support::toJsonValue<QList<ResponseProfile>>(m_responseProfiles);
result["SubtitleProfiles"] = Jellyfin::Support::toJsonValue<QList<SubtitleProfile>>(m_subtitleProfiles);
if (!(m_xmlRootAttributes.size() == 0)) {
result["XmlRootAttributes"] = Jellyfin::Support::toJsonValue<QList<XmlAttribute>>(m_xmlRootAttributes);
}
if (!(m_directPlayProfiles.size() == 0)) {
result["DirectPlayProfiles"] = Jellyfin::Support::toJsonValue<QList<DirectPlayProfile>>(m_directPlayProfiles);
}
if (!(m_transcodingProfiles.size() == 0)) {
result["TranscodingProfiles"] = Jellyfin::Support::toJsonValue<QList<TranscodingProfile>>(m_transcodingProfiles);
}
if (!(m_containerProfiles.size() == 0)) {
result["ContainerProfiles"] = Jellyfin::Support::toJsonValue<QList<ContainerProfile>>(m_containerProfiles);
}
if (!(m_codecProfiles.size() == 0)) {
result["CodecProfiles"] = Jellyfin::Support::toJsonValue<QList<CodecProfile>>(m_codecProfiles);
}
if (!(m_responseProfiles.size() == 0)) {
result["ResponseProfiles"] = Jellyfin::Support::toJsonValue<QList<ResponseProfile>>(m_responseProfiles);
}
if (!(m_subtitleProfiles.size() == 0)) {
result["SubtitleProfiles"] = Jellyfin::Support::toJsonValue<QList<SubtitleProfile>>(m_subtitleProfiles);
}
return result;
}

View file

@ -63,10 +63,18 @@ void DeviceProfileInfo::setFromJson(QJsonObject source) {
QJsonObject DeviceProfileInfo::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Type"] = Jellyfin::Support::toJsonValue<DeviceProfileType>(m_type);
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Type"] = Jellyfin::Support::toJsonValue<DeviceProfileType>(m_type);
return result;
}

View file

@ -66,11 +66,23 @@ void DirectPlayProfile::setFromJson(QJsonObject source) {
QJsonObject DirectPlayProfile::toJson() const {
QJsonObject result;
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);
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
if (!(m_audioCodec.isNull())) {
result["AudioCodec"] = Jellyfin::Support::toJsonValue<QString>(m_audioCodec);
}
if (!(m_videoCodec.isNull())) {
result["VideoCodec"] = Jellyfin::Support::toJsonValue<QString>(m_videoCodec);
}
result["Type"] = Jellyfin::Support::toJsonValue<DlnaProfileType>(m_type);
return result;
}

View file

@ -96,20 +96,44 @@ void DisplayPreferencesDto::setFromJson(QJsonObject source) {
QJsonObject DisplayPreferencesDto::toJson() const {
QJsonObject result;
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);
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_viewType.isNull())) {
result["ViewType"] = Jellyfin::Support::toJsonValue<QString>(m_viewType);
}
if (!(m_sortBy.isNull())) {
result["SortBy"] = Jellyfin::Support::toJsonValue<QString>(m_sortBy);
}
if (!(m_indexBy.isNull())) {
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);
if (!(m_customPrefs.isEmpty())) {
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);
if (!(m_client.isNull())) {
result["Client"] = Jellyfin::Support::toJsonValue<QString>(m_client);
}
return result;
}

View file

@ -60,9 +60,9 @@ void EndPointInfo::setFromJson(QJsonObject source) {
QJsonObject EndPointInfo::toJson() const {
QJsonObject result;
result["IsLocal"] = Jellyfin::Support::toJsonValue<bool>(m_isLocal);
result["IsInNetwork"] = Jellyfin::Support::toJsonValue<bool>(m_isInNetwork);
return result;
}

View file

@ -66,10 +66,22 @@ void ExternalIdInfo::setFromJson(QJsonObject source) {
QJsonObject ExternalIdInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Key"] = Jellyfin::Support::toJsonValue<QString>(m_key);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_key.isNull())) {
result["Key"] = Jellyfin::Support::toJsonValue<QString>(m_key);
}
result["Type"] = Jellyfin::Support::toJsonValue<ExternalIdMediaType>(m_type);
result["UrlFormatString"] = Jellyfin::Support::toJsonValue<QString>(m_urlFormatString);
if (!(m_urlFormatString.isNull())) {
result["UrlFormatString"] = Jellyfin::Support::toJsonValue<QString>(m_urlFormatString);
}
return result;
}

View file

@ -60,8 +60,16 @@ void ExternalUrl::setFromJson(QJsonObject source) {
QJsonObject ExternalUrl::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Url"] = Jellyfin::Support::toJsonValue<QString>(m_url);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_url.isNull())) {
result["Url"] = Jellyfin::Support::toJsonValue<QString>(m_url);
}
return result;
}

View file

@ -63,10 +63,18 @@ void FileSystemEntryInfo::setFromJson(QJsonObject source) {
QJsonObject FileSystemEntryInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["Type"] = Jellyfin::Support::toJsonValue<FileSystemEntryType>(m_type);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
result["Type"] = Jellyfin::Support::toJsonValue<FileSystemEntryType>(m_type);
return result;
}

View file

@ -66,11 +66,15 @@ void FontFile::setFromJson(QJsonObject source) {
QJsonObject FontFile::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_name.isNull())) {
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;
}

View file

@ -57,8 +57,8 @@ void ForgotPasswordDto::setFromJson(QJsonObject source) {
QJsonObject ForgotPasswordDto::toJson() const {
QJsonObject result;
result["EnteredUsername"] = Jellyfin::Support::toJsonValue<QString>(m_enteredUsername);
result["EnteredUsername"] = Jellyfin::Support::toJsonValue<QString>(m_enteredUsername);
return result;
}

View file

@ -63,9 +63,17 @@ void ForgotPasswordResult::setFromJson(QJsonObject source) {
QJsonObject ForgotPasswordResult::toJson() const {
QJsonObject result;
result["Action"] = Jellyfin::Support::toJsonValue<ForgotPasswordAction>(m_action);
result["PinFile"] = Jellyfin::Support::toJsonValue<QString>(m_pinFile);
result["PinExpirationDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_pinExpirationDate);
if (!(m_pinFile.isNull())) {
result["PinFile"] = Jellyfin::Support::toJsonValue<QString>(m_pinFile);
}
if (!(m_pinExpirationDate.isNull())) {
result["PinExpirationDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_pinExpirationDate);
}
return result;
}

View file

@ -63,9 +63,13 @@ void GeneralCommand::setFromJson(QJsonObject source) {
QJsonObject GeneralCommand::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<GeneralCommandType>(m_name);
result["ControllingUserId"] = Jellyfin::Support::toJsonValue<QString>(m_controllingUserId);
result["Arguments"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_arguments);
if (!(m_arguments.isEmpty())) {
result["Arguments"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_arguments);
}
return result;
}

View file

@ -135,33 +135,129 @@ void GetProgramsDto::setFromJson(QJsonObject source) {
QJsonObject GetProgramsDto::toJson() const {
QJsonObject result;
result["ChannelIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_channelIds);
if (!(m_channelIds.size() == 0)) {
result["ChannelIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_channelIds);
}
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
result["MinStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minStartDate);
result["HasAired"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasAired);
result["IsAiring"] = Jellyfin::Support::toJsonValue<std::optional<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<std::optional<bool>>(m_isMovie);
result["IsSeries"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSeries);
result["IsNews"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isNews);
result["IsKids"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isKids);
result["IsSports"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSports);
result["StartIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_startIndex);
result["Limit"] = Jellyfin::Support::toJsonValue<std::optional<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<QStringList>(m_genreIds);
result["EnableImages"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableImages);
if (!(m_minStartDate.isNull())) {
result["MinStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minStartDate);
}
if (!(!m_hasAired.has_value())) {
result["HasAired"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasAired);
}
if (!(!m_isAiring.has_value())) {
result["IsAiring"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isAiring);
}
if (!(m_maxStartDate.isNull())) {
result["MaxStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_maxStartDate);
}
if (!(m_minEndDate.isNull())) {
result["MinEndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minEndDate);
}
if (!(m_maxEndDate.isNull())) {
result["MaxEndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_maxEndDate);
}
if (!(!m_isMovie.has_value())) {
result["IsMovie"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isMovie);
}
if (!(!m_isSeries.has_value())) {
result["IsSeries"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSeries);
}
if (!(!m_isNews.has_value())) {
result["IsNews"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isNews);
}
if (!(!m_isKids.has_value())) {
result["IsKids"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isKids);
}
if (!(!m_isSports.has_value())) {
result["IsSports"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSports);
}
if (!(!m_startIndex.has_value())) {
result["StartIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_startIndex);
}
if (!(!m_limit.has_value())) {
result["Limit"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_limit);
}
if (!(m_sortBy.isNull())) {
result["SortBy"] = Jellyfin::Support::toJsonValue<QString>(m_sortBy);
}
if (!(m_sortOrder.isNull())) {
result["SortOrder"] = Jellyfin::Support::toJsonValue<QString>(m_sortOrder);
}
if (!(m_genres.size() == 0)) {
result["Genres"] = Jellyfin::Support::toJsonValue<QStringList>(m_genres);
}
if (!(m_genreIds.size() == 0)) {
result["GenreIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_genreIds);
}
if (!(!m_enableImages.has_value())) {
result["EnableImages"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableImages);
}
result["EnableTotalRecordCount"] = Jellyfin::Support::toJsonValue<bool>(m_enableTotalRecordCount);
result["ImageTypeLimit"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_imageTypeLimit);
result["EnableImageTypes"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_enableImageTypes);
result["EnableUserData"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableUserData);
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
if (!(!m_imageTypeLimit.has_value())) {
result["ImageTypeLimit"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_imageTypeLimit);
}
if (!(m_enableImageTypes.size() == 0)) {
result["EnableImageTypes"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_enableImageTypes);
}
if (!(!m_enableUserData.has_value())) {
result["EnableUserData"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableUserData);
}
if (!(m_seriesTimerId.isNull())) {
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
}
result["LibrarySeriesId"] = Jellyfin::Support::toJsonValue<QString>(m_librarySeriesId);
result["Fields"] = Jellyfin::Support::toJsonValue<QList<ItemFields>>(m_fields);
if (!(m_fields.size() == 0)) {
result["Fields"] = Jellyfin::Support::toJsonValue<QList<ItemFields>>(m_fields);
}
return result;
}

View file

@ -69,12 +69,20 @@ void GroupInfoDto::setFromJson(QJsonObject source) {
QJsonObject GroupInfoDto::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(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);
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
if (!(m_groupName.isNull())) {
result["GroupName"] = Jellyfin::Support::toJsonValue<QString>(m_groupName);
}
result["State"] = Jellyfin::Support::toJsonValue<GroupStateType>(m_state);
if (!(m_participants.size() == 0)) {
result["Participants"] = Jellyfin::Support::toJsonValue<QStringList>(m_participants);
}
result["LastUpdatedAt"] = Jellyfin::Support::toJsonValue<QDateTime>(m_lastUpdatedAt);
return result;
}

View file

@ -60,9 +60,9 @@ void GuideInfo::setFromJson(QJsonObject source) {
QJsonObject GuideInfo::toJson() const {
QJsonObject result;
result["StartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_startDate);
result["EndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_endDate);
return result;
}

View file

@ -63,10 +63,18 @@ void HttpHeaderInfo::setFromJson(QJsonObject source) {
QJsonObject HttpHeaderInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
result["Match"] = Jellyfin::Support::toJsonValue<HeaderMatchType>(m_match);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_value.isNull())) {
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
}
result["Match"] = Jellyfin::Support::toJsonValue<HeaderMatchType>(m_match);
return result;
}

View file

@ -57,8 +57,8 @@ void IgnoreWaitRequestDto::setFromJson(QJsonObject source) {
QJsonObject IgnoreWaitRequestDto::toJson() const {
QJsonObject result;
result["IgnoreWait"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreWait);
result["IgnoreWait"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreWait);
return result;
}

View file

@ -69,11 +69,27 @@ void ImageByNameInfo::setFromJson(QJsonObject source) {
QJsonObject ImageByNameInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Theme"] = Jellyfin::Support::toJsonValue<QString>(m_theme);
result["Context"] = Jellyfin::Support::toJsonValue<QString>(m_context);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_theme.isNull())) {
result["Theme"] = Jellyfin::Support::toJsonValue<QString>(m_theme);
}
if (!(m_context.isNull())) {
result["Context"] = Jellyfin::Support::toJsonValue<QString>(m_context);
}
result["FileLength"] = Jellyfin::Support::toJsonValue<qint64>(m_fileLength);
result["Format"] = Jellyfin::Support::toJsonValue<QString>(m_format);
if (!(m_format.isNull())) {
result["Format"] = Jellyfin::Support::toJsonValue<QString>(m_format);
}
return result;
}

View file

@ -78,15 +78,39 @@ void ImageInfo::setFromJson(QJsonObject source) {
QJsonObject ImageInfo::toJson() const {
QJsonObject result;
result["ImageType"] = Jellyfin::Support::toJsonValue<ImageType>(m_imageType);
result["ImageIndex"] = Jellyfin::Support::toJsonValue<std::optional<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<std::optional<qint32>>(m_height);
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
result["ImageType"] = Jellyfin::Support::toJsonValue<ImageType>(m_imageType);
if (!(!m_imageIndex.has_value())) {
result["ImageIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_imageIndex);
}
if (!(m_imageTag.isNull())) {
result["ImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_imageTag);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_blurHash.isNull())) {
result["BlurHash"] = Jellyfin::Support::toJsonValue<QString>(m_blurHash);
}
if (!(!m_height.has_value())) {
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_height);
}
if (!(!m_width.has_value())) {
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
}
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
return result;
}

View file

@ -63,10 +63,10 @@ void ImageOption::setFromJson(QJsonObject source) {
QJsonObject ImageOption::toJson() const {
QJsonObject result;
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;
}

View file

@ -60,8 +60,16 @@ void ImageProviderInfo::setFromJson(QJsonObject source) {
QJsonObject ImageProviderInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["SupportedImages"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImages);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_supportedImages.size() == 0)) {
result["SupportedImages"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImages);
}
return result;
}

View file

@ -72,12 +72,28 @@ void InstallationInfo::setFromJson(QJsonObject source) {
QJsonObject InstallationInfo::toJson() const {
QJsonObject result;
result["Guid"] = Jellyfin::Support::toJsonValue<QString>(m_guid);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_name.isNull())) {
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);
if (!(m_changelog.isNull())) {
result["Changelog"] = Jellyfin::Support::toJsonValue<QString>(m_changelog);
}
if (!(m_sourceUrl.isNull())) {
result["SourceUrl"] = Jellyfin::Support::toJsonValue<QString>(m_sourceUrl);
}
if (!(m_checksum.isNull())) {
result["Checksum"] = Jellyfin::Support::toJsonValue<QString>(m_checksum);
}
return result;
}

View file

@ -75,13 +75,29 @@ void IPlugin::setFromJson(QJsonObject source) {
QJsonObject IPlugin::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Description"] = Jellyfin::Support::toJsonValue<QString>(m_description);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_description.isNull())) {
result["Description"] = Jellyfin::Support::toJsonValue<QString>(m_description);
}
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Version"] = Jellyfin::Support::toJsonValue<QSharedPointer<Version>>(m_version);
result["AssemblyFilePath"] = Jellyfin::Support::toJsonValue<QString>(m_assemblyFilePath);
if (!(m_assemblyFilePath.isNull())) {
result["AssemblyFilePath"] = Jellyfin::Support::toJsonValue<QString>(m_assemblyFilePath);
}
result["CanUninstall"] = Jellyfin::Support::toJsonValue<bool>(m_canUninstall);
result["DataFolderPath"] = Jellyfin::Support::toJsonValue<QString>(m_dataFolderPath);
if (!(m_dataFolderPath.isNull())) {
result["DataFolderPath"] = Jellyfin::Support::toJsonValue<QString>(m_dataFolderPath);
}
return result;
}

View file

@ -90,6 +90,7 @@ void ItemCounts::setFromJson(QJsonObject source) {
QJsonObject ItemCounts::toJson() const {
QJsonObject result;
result["MovieCount"] = Jellyfin::Support::toJsonValue<qint32>(m_movieCount);
result["SeriesCount"] = Jellyfin::Support::toJsonValue<qint32>(m_seriesCount);
result["EpisodeCount"] = Jellyfin::Support::toJsonValue<qint32>(m_episodeCount);
@ -102,7 +103,6 @@ QJsonObject ItemCounts::toJson() const {
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;
}

View file

@ -57,8 +57,8 @@ void JoinGroupRequestDto::setFromJson(QJsonObject source) {
QJsonObject JoinGroupRequestDto::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
return result;
}

View file

@ -60,9 +60,13 @@ void LibraryOptionInfoDto::setFromJson(QJsonObject source) {
QJsonObject LibraryOptionInfoDto::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["DefaultEnabled"] = Jellyfin::Support::toJsonValue<bool>(m_defaultEnabled);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["DefaultEnabled"] = Jellyfin::Support::toJsonValue<bool>(m_defaultEnabled);
return result;
}

View file

@ -129,31 +129,75 @@ void LibraryOptions::setFromJson(QJsonObject source) {
QJsonObject LibraryOptions::toJson() const {
QJsonObject result;
result["EnablePhotos"] = Jellyfin::Support::toJsonValue<bool>(m_enablePhotos);
result["EnableRealtimeMonitor"] = Jellyfin::Support::toJsonValue<bool>(m_enableRealtimeMonitor);
result["EnableChapterImageExtraction"] = Jellyfin::Support::toJsonValue<bool>(m_enableChapterImageExtraction);
result["ExtractChapterImagesDuringLibraryScan"] = Jellyfin::Support::toJsonValue<bool>(m_extractChapterImagesDuringLibraryScan);
result["PathInfos"] = Jellyfin::Support::toJsonValue<QList<MediaPathInfo>>(m_pathInfos);
if (!(m_pathInfos.size() == 0)) {
result["PathInfos"] = Jellyfin::Support::toJsonValue<QList<MediaPathInfo>>(m_pathInfos);
}
result["SaveLocalMetadata"] = Jellyfin::Support::toJsonValue<bool>(m_saveLocalMetadata);
result["EnableInternetProviders"] = Jellyfin::Support::toJsonValue<bool>(m_enableInternetProviders);
result["EnableAutomaticSeriesGrouping"] = Jellyfin::Support::toJsonValue<bool>(m_enableAutomaticSeriesGrouping);
result["EnableEmbeddedTitles"] = Jellyfin::Support::toJsonValue<bool>(m_enableEmbeddedTitles);
result["EnableEmbeddedEpisodeInfos"] = Jellyfin::Support::toJsonValue<bool>(m_enableEmbeddedEpisodeInfos);
result["AutomaticRefreshIntervalDays"] = Jellyfin::Support::toJsonValue<qint32>(m_automaticRefreshIntervalDays);
result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataLanguage);
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
result["SeasonZeroDisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonZeroDisplayName);
result["MetadataSavers"] = Jellyfin::Support::toJsonValue<QStringList>(m_metadataSavers);
result["DisabledLocalMetadataReaders"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledLocalMetadataReaders);
result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_localMetadataReaderOrder);
result["DisabledSubtitleFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledSubtitleFetchers);
result["SubtitleFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_subtitleFetcherOrder);
if (!(m_preferredMetadataLanguage.isNull())) {
result["PreferredMetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredMetadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_seasonZeroDisplayName.isNull())) {
result["SeasonZeroDisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonZeroDisplayName);
}
if (!(m_metadataSavers.size() == 0)) {
result["MetadataSavers"] = Jellyfin::Support::toJsonValue<QStringList>(m_metadataSavers);
}
if (!(m_disabledLocalMetadataReaders.size() == 0)) {
result["DisabledLocalMetadataReaders"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledLocalMetadataReaders);
}
if (!(m_localMetadataReaderOrder.size() == 0)) {
result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_localMetadataReaderOrder);
}
if (!(m_disabledSubtitleFetchers.size() == 0)) {
result["DisabledSubtitleFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledSubtitleFetchers);
}
if (!(m_subtitleFetcherOrder.size() == 0)) {
result["SubtitleFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_subtitleFetcherOrder);
}
result["SkipSubtitlesIfEmbeddedSubtitlesPresent"] = Jellyfin::Support::toJsonValue<bool>(m_skipSubtitlesIfEmbeddedSubtitlesPresent);
result["SkipSubtitlesIfAudioTrackMatches"] = Jellyfin::Support::toJsonValue<bool>(m_skipSubtitlesIfAudioTrackMatches);
result["SubtitleDownloadLanguages"] = Jellyfin::Support::toJsonValue<QStringList>(m_subtitleDownloadLanguages);
if (!(m_subtitleDownloadLanguages.size() == 0)) {
result["SubtitleDownloadLanguages"] = Jellyfin::Support::toJsonValue<QStringList>(m_subtitleDownloadLanguages);
}
result["RequirePerfectSubtitleMatch"] = Jellyfin::Support::toJsonValue<bool>(m_requirePerfectSubtitleMatch);
result["SaveSubtitlesWithMedia"] = Jellyfin::Support::toJsonValue<bool>(m_saveSubtitlesWithMedia);
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<TypeOptions>>(m_typeOptions);
if (!(m_typeOptions.size() == 0)) {
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<TypeOptions>>(m_typeOptions);
}
return result;
}

View file

@ -66,10 +66,26 @@ void LibraryOptionsResultDto::setFromJson(QJsonObject source) {
QJsonObject LibraryOptionsResultDto::toJson() const {
QJsonObject result;
result["MetadataSavers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataSavers);
result["MetadataReaders"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataReaders);
result["SubtitleFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_subtitleFetchers);
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<LibraryTypeOptionsDto>>(m_typeOptions);
if (!(m_metadataSavers.size() == 0)) {
result["MetadataSavers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataSavers);
}
if (!(m_metadataReaders.size() == 0)) {
result["MetadataReaders"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataReaders);
}
if (!(m_subtitleFetchers.size() == 0)) {
result["SubtitleFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_subtitleFetchers);
}
if (!(m_typeOptions.size() == 0)) {
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<LibraryTypeOptionsDto>>(m_typeOptions);
}
return result;
}

View file

@ -69,11 +69,31 @@ void LibraryTypeOptionsDto::setFromJson(QJsonObject source) {
QJsonObject LibraryTypeOptionsDto::toJson() const {
QJsonObject result;
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
result["MetadataFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataFetchers);
result["ImageFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_imageFetchers);
result["SupportedImageTypes"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImageTypes);
result["DefaultImageOptions"] = Jellyfin::Support::toJsonValue<QList<ImageOption>>(m_defaultImageOptions);
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
if (!(m_metadataFetchers.size() == 0)) {
result["MetadataFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_metadataFetchers);
}
if (!(m_imageFetchers.size() == 0)) {
result["ImageFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_imageFetchers);
}
if (!(m_supportedImageTypes.size() == 0)) {
result["SupportedImageTypes"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImageTypes);
}
if (!(m_defaultImageOptions.size() == 0)) {
result["DefaultImageOptions"] = Jellyfin::Support::toJsonValue<QList<ImageOption>>(m_defaultImageOptions);
}
return result;
}

View file

@ -75,14 +75,38 @@ void LibraryUpdateInfo::setFromJson(QJsonObject source) {
QJsonObject LibraryUpdateInfo::toJson() const {
QJsonObject result;
result["FoldersAddedTo"] = Jellyfin::Support::toJsonValue<QStringList>(m_foldersAddedTo);
result["FoldersRemovedFrom"] = Jellyfin::Support::toJsonValue<QStringList>(m_foldersRemovedFrom);
result["ItemsAdded"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsAdded);
result["ItemsRemoved"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsRemoved);
result["ItemsUpdated"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsUpdated);
result["CollectionFolders"] = Jellyfin::Support::toJsonValue<QStringList>(m_collectionFolders);
result["IsEmpty"] = Jellyfin::Support::toJsonValue<bool>(m_isEmpty);
if (!(m_foldersAddedTo.size() == 0)) {
result["FoldersAddedTo"] = Jellyfin::Support::toJsonValue<QStringList>(m_foldersAddedTo);
}
if (!(m_foldersRemovedFrom.size() == 0)) {
result["FoldersRemovedFrom"] = Jellyfin::Support::toJsonValue<QStringList>(m_foldersRemovedFrom);
}
if (!(m_itemsAdded.size() == 0)) {
result["ItemsAdded"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsAdded);
}
if (!(m_itemsRemoved.size() == 0)) {
result["ItemsRemoved"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsRemoved);
}
if (!(m_itemsUpdated.size() == 0)) {
result["ItemsUpdated"] = Jellyfin::Support::toJsonValue<QStringList>(m_itemsUpdated);
}
if (!(m_collectionFolders.size() == 0)) {
result["CollectionFolders"] = Jellyfin::Support::toJsonValue<QStringList>(m_collectionFolders);
}
result["IsEmpty"] = Jellyfin::Support::toJsonValue<bool>(m_isEmpty);
return result;
}

View file

@ -108,24 +108,92 @@ void ListingsProviderInfo::setFromJson(QJsonObject source) {
QJsonObject ListingsProviderInfo::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
result["Username"] = Jellyfin::Support::toJsonValue<QString>(m_username);
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
result["ListingsId"] = Jellyfin::Support::toJsonValue<QString>(m_listingsId);
result["ZipCode"] = Jellyfin::Support::toJsonValue<QString>(m_zipCode);
result["Country"] = Jellyfin::Support::toJsonValue<QString>(m_country);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["EnabledTuners"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledTuners);
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
if (!(m_username.isNull())) {
result["Username"] = Jellyfin::Support::toJsonValue<QString>(m_username);
}
if (!(m_password.isNull())) {
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
}
if (!(m_listingsId.isNull())) {
result["ListingsId"] = Jellyfin::Support::toJsonValue<QString>(m_listingsId);
}
if (!(m_zipCode.isNull())) {
result["ZipCode"] = Jellyfin::Support::toJsonValue<QString>(m_zipCode);
}
if (!(m_country.isNull())) {
result["Country"] = Jellyfin::Support::toJsonValue<QString>(m_country);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_enabledTuners.size() == 0)) {
result["EnabledTuners"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledTuners);
}
result["EnableAllTuners"] = Jellyfin::Support::toJsonValue<bool>(m_enableAllTuners);
result["NewsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_newsCategories);
result["SportsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_sportsCategories);
result["KidsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_kidsCategories);
result["MovieCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_movieCategories);
result["ChannelMappings"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_channelMappings);
result["MoviePrefix"] = Jellyfin::Support::toJsonValue<QString>(m_moviePrefix);
result["PreferredLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredLanguage);
result["UserAgent"] = Jellyfin::Support::toJsonValue<QString>(m_userAgent);
if (!(m_newsCategories.size() == 0)) {
result["NewsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_newsCategories);
}
if (!(m_sportsCategories.size() == 0)) {
result["SportsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_sportsCategories);
}
if (!(m_kidsCategories.size() == 0)) {
result["KidsCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_kidsCategories);
}
if (!(m_movieCategories.size() == 0)) {
result["MovieCategories"] = Jellyfin::Support::toJsonValue<QStringList>(m_movieCategories);
}
if (!(m_channelMappings.size() == 0)) {
result["ChannelMappings"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_channelMappings);
}
if (!(m_moviePrefix.isNull())) {
result["MoviePrefix"] = Jellyfin::Support::toJsonValue<QString>(m_moviePrefix);
}
if (!(m_preferredLanguage.isNull())) {
result["PreferredLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_preferredLanguage);
}
if (!(m_userAgent.isNull())) {
result["UserAgent"] = Jellyfin::Support::toJsonValue<QString>(m_userAgent);
}
return result;
}

View file

@ -57,8 +57,8 @@ void LiveStreamResponse::setFromJson(QJsonObject source) {
QJsonObject LiveStreamResponse::toJson() const {
QJsonObject result;
result["MediaSource"] = Jellyfin::Support::toJsonValue<QSharedPointer<MediaSourceInfo>>(m_mediaSource);
result["MediaSource"] = Jellyfin::Support::toJsonValue<QSharedPointer<MediaSourceInfo>>(m_mediaSource);
return result;
}

View file

@ -63,9 +63,17 @@ void LiveTvInfo::setFromJson(QJsonObject source) {
QJsonObject LiveTvInfo::toJson() const {
QJsonObject result;
result["Services"] = Jellyfin::Support::toJsonValue<QList<LiveTvServiceInfo>>(m_services);
if (!(m_services.size() == 0)) {
result["Services"] = Jellyfin::Support::toJsonValue<QList<LiveTvServiceInfo>>(m_services);
}
result["IsEnabled"] = Jellyfin::Support::toJsonValue<bool>(m_isEnabled);
result["EnabledUsers"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledUsers);
if (!(m_enabledUsers.size() == 0)) {
result["EnabledUsers"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledUsers);
}
return result;
}

View file

@ -78,14 +78,34 @@ void LiveTvServiceInfo::setFromJson(QJsonObject source) {
QJsonObject LiveTvServiceInfo::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["HomePageUrl"] = Jellyfin::Support::toJsonValue<QString>(m_homePageUrl);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_homePageUrl.isNull())) {
result["HomePageUrl"] = Jellyfin::Support::toJsonValue<QString>(m_homePageUrl);
}
result["Status"] = Jellyfin::Support::toJsonValue<LiveTvServiceStatus>(m_status);
result["StatusMessage"] = Jellyfin::Support::toJsonValue<QString>(m_statusMessage);
result["Version"] = Jellyfin::Support::toJsonValue<QString>(m_version);
if (!(m_statusMessage.isNull())) {
result["StatusMessage"] = Jellyfin::Support::toJsonValue<QString>(m_statusMessage);
}
if (!(m_version.isNull())) {
result["Version"] = Jellyfin::Support::toJsonValue<QString>(m_version);
}
result["HasUpdateAvailable"] = Jellyfin::Support::toJsonValue<bool>(m_hasUpdateAvailable);
result["IsVisible"] = Jellyfin::Support::toJsonValue<bool>(m_isVisible);
result["Tuners"] = Jellyfin::Support::toJsonValue<QStringList>(m_tuners);
if (!(m_tuners.size() == 0)) {
result["Tuners"] = Jellyfin::Support::toJsonValue<QStringList>(m_tuners);
}
return result;
}

View file

@ -60,8 +60,16 @@ void LocalizationOption::setFromJson(QJsonObject source) {
QJsonObject LocalizationOption::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_value.isNull())) {
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
}
return result;
}

View file

@ -66,10 +66,14 @@ void LogFile::setFromJson(QJsonObject source) {
QJsonObject LogFile::toJson() const {
QJsonObject result;
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
result["DateModified"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateModified);
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
return result;
}

View file

@ -75,13 +75,37 @@ void MediaAttachment::setFromJson(QJsonObject source) {
QJsonObject MediaAttachment::toJson() const {
QJsonObject result;
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
result["CodecTag"] = Jellyfin::Support::toJsonValue<QString>(m_codecTag);
result["Comment"] = Jellyfin::Support::toJsonValue<QString>(m_comment);
if (!(m_codec.isNull())) {
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
}
if (!(m_codecTag.isNull())) {
result["CodecTag"] = Jellyfin::Support::toJsonValue<QString>(m_codecTag);
}
if (!(m_comment.isNull())) {
result["Comment"] = Jellyfin::Support::toJsonValue<QString>(m_comment);
}
result["Index"] = Jellyfin::Support::toJsonValue<qint32>(m_index);
result["FileName"] = Jellyfin::Support::toJsonValue<QString>(m_fileName);
result["MimeType"] = Jellyfin::Support::toJsonValue<QString>(m_mimeType);
result["DeliveryUrl"] = Jellyfin::Support::toJsonValue<QString>(m_deliveryUrl);
if (!(m_fileName.isNull())) {
result["FileName"] = Jellyfin::Support::toJsonValue<QString>(m_fileName);
}
if (!(m_mimeType.isNull())) {
result["MimeType"] = Jellyfin::Support::toJsonValue<QString>(m_mimeType);
}
if (!(m_deliveryUrl.isNull())) {
result["DeliveryUrl"] = Jellyfin::Support::toJsonValue<QString>(m_deliveryUrl);
}
return result;
}

View file

@ -60,8 +60,16 @@ void MediaEncoderPathDto::setFromJson(QJsonObject source) {
QJsonObject MediaEncoderPathDto::toJson() const {
QJsonObject result;
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["PathType"] = Jellyfin::Support::toJsonValue<QString>(m_pathType);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_pathType.isNull())) {
result["PathType"] = Jellyfin::Support::toJsonValue<QString>(m_pathType);
}
return result;
}

View file

@ -63,10 +63,14 @@ void MediaPathDto::setFromJson(QJsonObject source) {
QJsonObject MediaPathDto::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["PathInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<MediaPathInfo>>(m_pathInfo);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
result["PathInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<MediaPathInfo>>(m_pathInfo);
return result;
}

View file

@ -60,8 +60,16 @@ void MediaPathInfo::setFromJson(QJsonObject source) {
QJsonObject MediaPathInfo::toJson() const {
QJsonObject result;
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["NetworkPath"] = Jellyfin::Support::toJsonValue<QString>(m_networkPath);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_networkPath.isNull())) {
result["NetworkPath"] = Jellyfin::Support::toJsonValue<QString>(m_networkPath);
}
return result;
}

View file

@ -180,18 +180,51 @@ void MediaSourceInfo::setFromJson(QJsonObject source) {
QJsonObject MediaSourceInfo::toJson() const {
QJsonObject result;
result["Protocol"] = Jellyfin::Support::toJsonValue<MediaProtocol>(m_protocol);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["EncoderPath"] = Jellyfin::Support::toJsonValue<QString>(m_encoderPath);
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_encoderPath.isNull())) {
result["EncoderPath"] = Jellyfin::Support::toJsonValue<QString>(m_encoderPath);
}
result["EncoderProtocol"] = Jellyfin::Support::toJsonValue<MediaProtocol>(m_encoderProtocol);
result["Type"] = Jellyfin::Support::toJsonValue<MediaSourceType>(m_type);
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
result["Size"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_size);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
if (!(!m_size.has_value())) {
result["Size"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_size);
}
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["IsRemote"] = Jellyfin::Support::toJsonValue<bool>(m_isRemote);
result["ETag"] = Jellyfin::Support::toJsonValue<QString>(m_eTag);
result["RunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_runTimeTicks);
if (!(m_eTag.isNull())) {
result["ETag"] = Jellyfin::Support::toJsonValue<QString>(m_eTag);
}
if (!(!m_runTimeTicks.has_value())) {
result["RunTimeTicks"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_runTimeTicks);
}
result["ReadAtNativeFramerate"] = Jellyfin::Support::toJsonValue<bool>(m_readAtNativeFramerate);
result["IgnoreDts"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreDts);
result["IgnoreIndex"] = Jellyfin::Support::toJsonValue<bool>(m_ignoreIndex);
@ -201,27 +234,82 @@ QJsonObject MediaSourceInfo::toJson() const {
result["SupportsDirectPlay"] = Jellyfin::Support::toJsonValue<bool>(m_supportsDirectPlay);
result["IsInfiniteStream"] = Jellyfin::Support::toJsonValue<bool>(m_isInfiniteStream);
result["RequiresOpening"] = Jellyfin::Support::toJsonValue<bool>(m_requiresOpening);
result["OpenToken"] = Jellyfin::Support::toJsonValue<QString>(m_openToken);
if (!(m_openToken.isNull())) {
result["OpenToken"] = Jellyfin::Support::toJsonValue<QString>(m_openToken);
}
result["RequiresClosing"] = Jellyfin::Support::toJsonValue<bool>(m_requiresClosing);
result["LiveStreamId"] = Jellyfin::Support::toJsonValue<QString>(m_liveStreamId);
result["BufferMs"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bufferMs);
if (!(m_liveStreamId.isNull())) {
result["LiveStreamId"] = Jellyfin::Support::toJsonValue<QString>(m_liveStreamId);
}
if (!(!m_bufferMs.has_value())) {
result["BufferMs"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bufferMs);
}
result["RequiresLooping"] = Jellyfin::Support::toJsonValue<bool>(m_requiresLooping);
result["SupportsProbing"] = Jellyfin::Support::toJsonValue<bool>(m_supportsProbing);
result["VideoType"] = Jellyfin::Support::toJsonValue<VideoType>(m_videoType);
result["IsoType"] = Jellyfin::Support::toJsonValue<IsoType>(m_isoType);
result["Video3DFormat"] = Jellyfin::Support::toJsonValue<Video3DFormat>(m_video3DFormat);
result["MediaStreams"] = Jellyfin::Support::toJsonValue<QList<MediaStream>>(m_mediaStreams);
result["MediaAttachments"] = Jellyfin::Support::toJsonValue<QList<MediaAttachment>>(m_mediaAttachments);
result["Formats"] = Jellyfin::Support::toJsonValue<QStringList>(m_formats);
result["Bitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitrate);
if (!(m_mediaStreams.size() == 0)) {
result["MediaStreams"] = Jellyfin::Support::toJsonValue<QList<MediaStream>>(m_mediaStreams);
}
if (!(m_mediaAttachments.size() == 0)) {
result["MediaAttachments"] = Jellyfin::Support::toJsonValue<QList<MediaAttachment>>(m_mediaAttachments);
}
if (!(m_formats.size() == 0)) {
result["Formats"] = Jellyfin::Support::toJsonValue<QStringList>(m_formats);
}
if (!(!m_bitrate.has_value())) {
result["Bitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitrate);
}
result["Timestamp"] = Jellyfin::Support::toJsonValue<TransportStreamTimestamp>(m_timestamp);
result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_requiredHttpHeaders);
result["TranscodingUrl"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingUrl);
result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingSubProtocol);
result["TranscodingContainer"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingContainer);
result["AnalyzeDurationMs"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_analyzeDurationMs);
result["DefaultAudioStreamIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_defaultAudioStreamIndex);
result["DefaultSubtitleStreamIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_defaultSubtitleStreamIndex);
if (!(m_requiredHttpHeaders.isEmpty())) {
result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_requiredHttpHeaders);
}
if (!(m_transcodingUrl.isNull())) {
result["TranscodingUrl"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingUrl);
}
if (!(m_transcodingSubProtocol.isNull())) {
result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingSubProtocol);
}
if (!(m_transcodingContainer.isNull())) {
result["TranscodingContainer"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingContainer);
}
if (!(!m_analyzeDurationMs.has_value())) {
result["AnalyzeDurationMs"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_analyzeDurationMs);
}
if (!(!m_defaultAudioStreamIndex.has_value())) {
result["DefaultAudioStreamIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_defaultAudioStreamIndex);
}
if (!(!m_defaultSubtitleStreamIndex.has_value())) {
result["DefaultSubtitleStreamIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_defaultSubtitleStreamIndex);
}
return result;
}

View file

@ -195,53 +195,205 @@ void MediaStream::setFromJson(QJsonObject source) {
QJsonObject MediaStream::toJson() const {
QJsonObject result;
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
result["CodecTag"] = Jellyfin::Support::toJsonValue<QString>(m_codecTag);
result["Language"] = Jellyfin::Support::toJsonValue<QString>(m_language);
result["ColorRange"] = Jellyfin::Support::toJsonValue<QString>(m_colorRange);
result["ColorSpace"] = Jellyfin::Support::toJsonValue<QString>(m_colorSpace);
result["ColorTransfer"] = Jellyfin::Support::toJsonValue<QString>(m_colorTransfer);
result["ColorPrimaries"] = Jellyfin::Support::toJsonValue<QString>(m_colorPrimaries);
result["Comment"] = Jellyfin::Support::toJsonValue<QString>(m_comment);
result["TimeBase"] = Jellyfin::Support::toJsonValue<QString>(m_timeBase);
result["CodecTimeBase"] = Jellyfin::Support::toJsonValue<QString>(m_codecTimeBase);
result["Title"] = Jellyfin::Support::toJsonValue<QString>(m_title);
result["VideoRange"] = Jellyfin::Support::toJsonValue<QString>(m_videoRange);
result["localizedUndefined"] = Jellyfin::Support::toJsonValue<QString>(m_localizedUndefined);
result["localizedDefault"] = Jellyfin::Support::toJsonValue<QString>(m_localizedDefault);
result["localizedForced"] = Jellyfin::Support::toJsonValue<QString>(m_localizedForced);
result["DisplayTitle"] = Jellyfin::Support::toJsonValue<QString>(m_displayTitle);
result["NalLengthSize"] = Jellyfin::Support::toJsonValue<QString>(m_nalLengthSize);
if (!(m_codec.isNull())) {
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
}
if (!(m_codecTag.isNull())) {
result["CodecTag"] = Jellyfin::Support::toJsonValue<QString>(m_codecTag);
}
if (!(m_language.isNull())) {
result["Language"] = Jellyfin::Support::toJsonValue<QString>(m_language);
}
if (!(m_colorRange.isNull())) {
result["ColorRange"] = Jellyfin::Support::toJsonValue<QString>(m_colorRange);
}
if (!(m_colorSpace.isNull())) {
result["ColorSpace"] = Jellyfin::Support::toJsonValue<QString>(m_colorSpace);
}
if (!(m_colorTransfer.isNull())) {
result["ColorTransfer"] = Jellyfin::Support::toJsonValue<QString>(m_colorTransfer);
}
if (!(m_colorPrimaries.isNull())) {
result["ColorPrimaries"] = Jellyfin::Support::toJsonValue<QString>(m_colorPrimaries);
}
if (!(m_comment.isNull())) {
result["Comment"] = Jellyfin::Support::toJsonValue<QString>(m_comment);
}
if (!(m_timeBase.isNull())) {
result["TimeBase"] = Jellyfin::Support::toJsonValue<QString>(m_timeBase);
}
if (!(m_codecTimeBase.isNull())) {
result["CodecTimeBase"] = Jellyfin::Support::toJsonValue<QString>(m_codecTimeBase);
}
if (!(m_title.isNull())) {
result["Title"] = Jellyfin::Support::toJsonValue<QString>(m_title);
}
if (!(m_videoRange.isNull())) {
result["VideoRange"] = Jellyfin::Support::toJsonValue<QString>(m_videoRange);
}
if (!(m_localizedUndefined.isNull())) {
result["localizedUndefined"] = Jellyfin::Support::toJsonValue<QString>(m_localizedUndefined);
}
if (!(m_localizedDefault.isNull())) {
result["localizedDefault"] = Jellyfin::Support::toJsonValue<QString>(m_localizedDefault);
}
if (!(m_localizedForced.isNull())) {
result["localizedForced"] = Jellyfin::Support::toJsonValue<QString>(m_localizedForced);
}
if (!(m_displayTitle.isNull())) {
result["DisplayTitle"] = Jellyfin::Support::toJsonValue<QString>(m_displayTitle);
}
if (!(m_nalLengthSize.isNull())) {
result["NalLengthSize"] = Jellyfin::Support::toJsonValue<QString>(m_nalLengthSize);
}
result["IsInterlaced"] = Jellyfin::Support::toJsonValue<bool>(m_isInterlaced);
result["IsAVC"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isAVC);
result["ChannelLayout"] = Jellyfin::Support::toJsonValue<QString>(m_channelLayout);
result["BitRate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitRate);
result["BitDepth"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitDepth);
result["RefFrames"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_refFrames);
result["PacketLength"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_packetLength);
result["Channels"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_channels);
result["SampleRate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_sampleRate);
if (!(!m_isAVC.has_value())) {
result["IsAVC"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isAVC);
}
if (!(m_channelLayout.isNull())) {
result["ChannelLayout"] = Jellyfin::Support::toJsonValue<QString>(m_channelLayout);
}
if (!(!m_bitRate.has_value())) {
result["BitRate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitRate);
}
if (!(!m_bitDepth.has_value())) {
result["BitDepth"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitDepth);
}
if (!(!m_refFrames.has_value())) {
result["RefFrames"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_refFrames);
}
if (!(!m_packetLength.has_value())) {
result["PacketLength"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_packetLength);
}
if (!(!m_channels.has_value())) {
result["Channels"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_channels);
}
if (!(!m_sampleRate.has_value())) {
result["SampleRate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_sampleRate);
}
result["IsDefault"] = Jellyfin::Support::toJsonValue<bool>(m_isDefault);
result["IsForced"] = Jellyfin::Support::toJsonValue<bool>(m_isForced);
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_height);
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
result["AverageFrameRate"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_averageFrameRate);
result["RealFrameRate"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_realFrameRate);
result["Profile"] = Jellyfin::Support::toJsonValue<QString>(m_profile);
if (!(!m_height.has_value())) {
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_height);
}
if (!(!m_width.has_value())) {
result["Width"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_width);
}
if (!(!m_averageFrameRate.has_value())) {
result["AverageFrameRate"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_averageFrameRate);
}
if (!(!m_realFrameRate.has_value())) {
result["RealFrameRate"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_realFrameRate);
}
if (!(m_profile.isNull())) {
result["Profile"] = Jellyfin::Support::toJsonValue<QString>(m_profile);
}
result["Type"] = Jellyfin::Support::toJsonValue<MediaStreamType>(m_type);
result["AspectRatio"] = Jellyfin::Support::toJsonValue<QString>(m_aspectRatio);
if (!(m_aspectRatio.isNull())) {
result["AspectRatio"] = Jellyfin::Support::toJsonValue<QString>(m_aspectRatio);
}
result["Index"] = Jellyfin::Support::toJsonValue<qint32>(m_index);
result["Score"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_score);
if (!(!m_score.has_value())) {
result["Score"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_score);
}
result["IsExternal"] = Jellyfin::Support::toJsonValue<bool>(m_isExternal);
result["DeliveryMethod"] = Jellyfin::Support::toJsonValue<SubtitleDeliveryMethod>(m_deliveryMethod);
result["DeliveryUrl"] = Jellyfin::Support::toJsonValue<QString>(m_deliveryUrl);
result["IsExternalUrl"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isExternalUrl);
if (!(m_deliveryUrl.isNull())) {
result["DeliveryUrl"] = Jellyfin::Support::toJsonValue<QString>(m_deliveryUrl);
}
if (!(!m_isExternalUrl.has_value())) {
result["IsExternalUrl"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isExternalUrl);
}
result["IsTextSubtitleStream"] = Jellyfin::Support::toJsonValue<bool>(m_isTextSubtitleStream);
result["SupportsExternalStream"] = Jellyfin::Support::toJsonValue<bool>(m_supportsExternalStream);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["PixelFormat"] = Jellyfin::Support::toJsonValue<QString>(m_pixelFormat);
result["Level"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_level);
result["IsAnamorphic"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isAnamorphic);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_pixelFormat.isNull())) {
result["PixelFormat"] = Jellyfin::Support::toJsonValue<QString>(m_pixelFormat);
}
if (!(!m_level.has_value())) {
result["Level"] = Jellyfin::Support::toJsonValue<std::optional<double>>(m_level);
}
if (!(!m_isAnamorphic.has_value())) {
result["IsAnamorphic"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isAnamorphic);
}
return result;
}

View file

@ -60,8 +60,16 @@ void MediaUpdateInfoDto::setFromJson(QJsonObject source) {
QJsonObject MediaUpdateInfoDto::toJson() const {
QJsonObject result;
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["UpdateType"] = Jellyfin::Support::toJsonValue<QString>(m_updateType);
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_updateType.isNull())) {
result["UpdateType"] = Jellyfin::Support::toJsonValue<QString>(m_updateType);
}
return result;
}

View file

@ -60,8 +60,16 @@ void MediaUrl::setFromJson(QJsonObject source) {
QJsonObject MediaUrl::toJson() const {
QJsonObject result;
result["Url"] = Jellyfin::Support::toJsonValue<QString>(m_url);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_url.isNull())) {
result["Url"] = Jellyfin::Support::toJsonValue<QString>(m_url);
}
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
return result;
}

View file

@ -72,12 +72,36 @@ void MetadataEditorInfo::setFromJson(QJsonObject source) {
QJsonObject MetadataEditorInfo::toJson() const {
QJsonObject result;
result["ParentalRatingOptions"] = Jellyfin::Support::toJsonValue<QList<ParentalRating>>(m_parentalRatingOptions);
result["Countries"] = Jellyfin::Support::toJsonValue<QList<CountryInfo>>(m_countries);
result["Cultures"] = Jellyfin::Support::toJsonValue<QList<CultureDto>>(m_cultures);
result["ExternalIdInfos"] = Jellyfin::Support::toJsonValue<QList<ExternalIdInfo>>(m_externalIdInfos);
result["ContentType"] = Jellyfin::Support::toJsonValue<QString>(m_contentType);
result["ContentTypeOptions"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_contentTypeOptions);
if (!(m_parentalRatingOptions.size() == 0)) {
result["ParentalRatingOptions"] = Jellyfin::Support::toJsonValue<QList<ParentalRating>>(m_parentalRatingOptions);
}
if (!(m_countries.size() == 0)) {
result["Countries"] = Jellyfin::Support::toJsonValue<QList<CountryInfo>>(m_countries);
}
if (!(m_cultures.size() == 0)) {
result["Cultures"] = Jellyfin::Support::toJsonValue<QList<CultureDto>>(m_cultures);
}
if (!(m_externalIdInfos.size() == 0)) {
result["ExternalIdInfos"] = Jellyfin::Support::toJsonValue<QList<ExternalIdInfo>>(m_externalIdInfos);
}
if (!(m_contentType.isNull())) {
result["ContentType"] = Jellyfin::Support::toJsonValue<QString>(m_contentType);
}
if (!(m_contentTypeOptions.size() == 0)) {
result["ContentTypeOptions"] = Jellyfin::Support::toJsonValue<QList<NameValuePair>>(m_contentTypeOptions);
}
return result;
}

View file

@ -75,13 +75,41 @@ void MetadataOptions::setFromJson(QJsonObject source) {
QJsonObject MetadataOptions::toJson() const {
QJsonObject result;
result["ItemType"] = Jellyfin::Support::toJsonValue<QString>(m_itemType);
result["DisabledMetadataSavers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledMetadataSavers);
result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_localMetadataReaderOrder);
result["DisabledMetadataFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledMetadataFetchers);
result["MetadataFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_metadataFetcherOrder);
result["DisabledImageFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledImageFetchers);
result["ImageFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_imageFetcherOrder);
if (!(m_itemType.isNull())) {
result["ItemType"] = Jellyfin::Support::toJsonValue<QString>(m_itemType);
}
if (!(m_disabledMetadataSavers.size() == 0)) {
result["DisabledMetadataSavers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledMetadataSavers);
}
if (!(m_localMetadataReaderOrder.size() == 0)) {
result["LocalMetadataReaderOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_localMetadataReaderOrder);
}
if (!(m_disabledMetadataFetchers.size() == 0)) {
result["DisabledMetadataFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledMetadataFetchers);
}
if (!(m_metadataFetcherOrder.size() == 0)) {
result["MetadataFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_metadataFetcherOrder);
}
if (!(m_disabledImageFetchers.size() == 0)) {
result["DisabledImageFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledImageFetchers);
}
if (!(m_imageFetcherOrder.size() == 0)) {
result["ImageFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_imageFetcherOrder);
}
return result;
}

View file

@ -60,9 +60,9 @@ void MovePlaylistItemRequestDto::setFromJson(QJsonObject source) {
QJsonObject MovePlaylistItemRequestDto::toJson() const {
QJsonObject result;
result["PlaylistItemId"] = Jellyfin::Support::toJsonValue<QString>(m_playlistItemId);
result["NewIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_newIndex);
return result;
}

View file

@ -84,17 +84,53 @@ void MovieInfo::setFromJson(QJsonObject source) {
QJsonObject MovieInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
return result;
}

View file

@ -66,11 +66,15 @@ void MovieInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject MovieInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<MovieInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -87,17 +87,57 @@ void MusicVideoInfo::setFromJson(QJsonObject source) {
QJsonObject MusicVideoInfo::toJson() const {
QJsonObject result;
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<std::optional<qint32>>(m_year);
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_metadataLanguage.isNull())) {
result["MetadataLanguage"] = Jellyfin::Support::toJsonValue<QString>(m_metadataLanguage);
}
if (!(m_metadataCountryCode.isNull())) {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_providerIds.isEmpty())) {
result["ProviderIds"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_providerIds);
}
if (!(!m_year.has_value())) {
result["Year"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_year);
}
if (!(!m_indexNumber.has_value())) {
result["IndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_indexNumber);
}
if (!(!m_parentIndexNumber.has_value())) {
result["ParentIndexNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_parentIndexNumber);
}
if (!(m_premiereDate.isNull())) {
result["PremiereDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_premiereDate);
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
result["Artists"] = Jellyfin::Support::toJsonValue<QStringList>(m_artists);
if (!(m_artists.size() == 0)) {
result["Artists"] = Jellyfin::Support::toJsonValue<QStringList>(m_artists);
}
return result;
}

View file

@ -66,11 +66,15 @@ void MusicVideoInfoRemoteSearchQuery::setFromJson(QJsonObject source) {
QJsonObject MusicVideoInfoRemoteSearchQuery::toJson() const {
QJsonObject result;
result["SearchInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<MusicVideoInfo>>(m_searchInfo);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
if (!(m_searchProviderName.isNull())) {
result["SearchProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_searchProviderName);
}
result["IncludeDisabledProviders"] = Jellyfin::Support::toJsonValue<bool>(m_includeDisabledProviders);
return result;
}

View file

@ -60,9 +60,13 @@ void NameGuidPair::setFromJson(QJsonObject source) {
QJsonObject NameGuidPair::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
return result;
}

View file

@ -60,8 +60,16 @@ void NameIdPair::setFromJson(QJsonObject source) {
QJsonObject NameIdPair::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
return result;
}

View file

@ -60,8 +60,16 @@ void NameValuePair::setFromJson(QJsonObject source) {
QJsonObject NameValuePair::toJson() const {
QJsonObject result;
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_value.isNull())) {
result["Value"] = Jellyfin::Support::toJsonValue<QString>(m_value);
}
return result;
}

Some files were not shown because too many files have changed in this diff Show more