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

[2/3] update openapi spec: generate code

This updates the openapi spec and invokes the code generator to update
to the Jellyfin 10.10.6 API.

A big motivation to do this was because some mandatory fields have been
made obsolete and are no longer included in responses. Sailfin tries to
deserialize these mandatory fields and fails deserializing. It was evident
in the list of sessions to control.

The failing was a bit too gracefully in my opinion, it did not even show
that an error occurred, nor was it logged anywhere. It took some time
to debug.
This commit is contained in:
Chris Josten 2025-03-13 02:39:07 +01:00 committed by Chris Josten
parent f71c7a991b
commit 9e1a20cd3a
504 changed files with 62190 additions and 41202 deletions

View file

@ -35,11 +35,15 @@ namespace DTO {
ActivityLogEntry::ActivityLogEntry() {}
ActivityLogEntry::ActivityLogEntry (
qint64 jellyfinId,
QString name,
QString type,
QDateTime date,
QString userId,
LogLevel severity
) :
m_jellyfinId(jellyfinId),
m_name(name),
m_type(type),
m_date(date),
m_userId(userId),
m_severity(severity) { }
@ -98,11 +102,7 @@ QJsonObject ActivityLogEntry::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<qint64>(m_jellyfinId);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_overview.isNull())) {
result["Overview"] = Jellyfin::Support::toJsonValue<QString>(m_overview);
@ -113,11 +113,7 @@ QJsonObject ActivityLogEntry::toJson() const {
result["ShortOverview"] = Jellyfin::Support::toJsonValue<QString>(m_shortOverview);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
if (!(m_itemId.isNull())) {
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
@ -145,14 +141,7 @@ QString ActivityLogEntry::name() const { return m_name; }
void ActivityLogEntry::setName(QString newName) {
m_name = newName;
}
bool ActivityLogEntry::nameNull() const {
return m_name.isNull();
}
void ActivityLogEntry::setNameNull() {
m_name.clear();
}
QString ActivityLogEntry::overview() const { return m_overview; }
void ActivityLogEntry::setOverview(QString newOverview) {
@ -184,14 +173,7 @@ QString ActivityLogEntry::type() const { return m_type; }
void ActivityLogEntry::setType(QString newType) {
m_type = newType;
}
bool ActivityLogEntry::typeNull() const {
return m_type.isNull();
}
void ActivityLogEntry::setTypeNull() {
m_type.clear();
}
QString ActivityLogEntry::itemId() const { return m_itemId; }
void ActivityLogEntry::setItemId(QString newItemId) {

View file

@ -0,0 +1,129 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/activitylogentrymessage.h>
namespace Jellyfin {
namespace DTO {
ActivityLogEntryMessage::ActivityLogEntryMessage() {}
ActivityLogEntryMessage::ActivityLogEntryMessage (
QString messageId,
SessionMessageType messageType
) :
m_messageId(messageId),
m_messageType(messageType) { }
ActivityLogEntryMessage::ActivityLogEntryMessage(const ActivityLogEntryMessage &other) :
m_data(other.m_data),
m_messageId(other.m_messageId),
m_messageType(other.m_messageType){}
void ActivityLogEntryMessage::replaceData(ActivityLogEntryMessage &other) {
m_data = other.m_data;
m_messageId = other.m_messageId;
m_messageType = other.m_messageType;
}
ActivityLogEntryMessage ActivityLogEntryMessage::fromJson(QJsonObject source) {
ActivityLogEntryMessage instance;
instance.setFromJson(source);
return instance;
}
void ActivityLogEntryMessage::setFromJson(QJsonObject source) {
m_data = Jellyfin::Support::fromJsonValue<QList<ActivityLogEntry>>(source["Data"]);
m_messageId = Jellyfin::Support::fromJsonValue<QString>(source["MessageId"]);
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject ActivityLogEntryMessage::toJson() const {
QJsonObject result;
if (!(m_data.size() == 0)) {
result["Data"] = Jellyfin::Support::toJsonValue<QList<ActivityLogEntry>>(m_data);
}
result["MessageId"] = Jellyfin::Support::toJsonValue<QString>(m_messageId);
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
QList<ActivityLogEntry> ActivityLogEntryMessage::data() const { return m_data; }
void ActivityLogEntryMessage::setData(QList<ActivityLogEntry> newData) {
m_data = newData;
}
bool ActivityLogEntryMessage::dataNull() const {
return m_data.size() == 0;
}
void ActivityLogEntryMessage::setDataNull() {
m_data.clear();
}
QString ActivityLogEntryMessage::messageId() const { return m_messageId; }
void ActivityLogEntryMessage::setMessageId(QString newMessageId) {
m_messageId = newMessageId;
}
SessionMessageType ActivityLogEntryMessage::messageType() const { return m_messageType; }
void ActivityLogEntryMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using ActivityLogEntryMessage = Jellyfin::DTO::ActivityLogEntryMessage;
template <>
ActivityLogEntryMessage fromJsonValue(const QJsonValue &source, convertType<ActivityLogEntryMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ActivityLogEntryMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ActivityLogEntryMessage &source, convertType<ActivityLogEntryMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,9 +34,11 @@ namespace DTO {
ActivityLogEntryQueryResult::ActivityLogEntryQueryResult() {}
ActivityLogEntryQueryResult::ActivityLogEntryQueryResult (
QList<ActivityLogEntry> items,
qint32 totalRecordCount,
qint32 startIndex
) :
m_items(items),
m_totalRecordCount(totalRecordCount),
m_startIndex(startIndex) { }
@ -72,11 +74,7 @@ void ActivityLogEntryQueryResult::setFromJson(QJsonObject source) {
QJsonObject ActivityLogEntryQueryResult::toJson() const {
QJsonObject result;
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<ActivityLogEntry>>(m_items);
}
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;
@ -87,14 +85,7 @@ QList<ActivityLogEntry> ActivityLogEntryQueryResult::items() const { return m_it
void ActivityLogEntryQueryResult::setItems(QList<ActivityLogEntry> newItems) {
m_items = newItems;
}
bool ActivityLogEntryQueryResult::itemsNull() const {
return m_items.size() == 0;
}
void ActivityLogEntryQueryResult::setItemsNull() {
m_items.clear();
}
qint32 ActivityLogEntryQueryResult::totalRecordCount() const { return m_totalRecordCount; }
void ActivityLogEntryQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {

View file

@ -0,0 +1,117 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/activitylogentrystartmessage.h>
namespace Jellyfin {
namespace DTO {
ActivityLogEntryStartMessage::ActivityLogEntryStartMessage() {}
ActivityLogEntryStartMessage::ActivityLogEntryStartMessage (
SessionMessageType messageType
) :
m_messageType(messageType) { }
ActivityLogEntryStartMessage::ActivityLogEntryStartMessage(const ActivityLogEntryStartMessage &other) :
m_data(other.m_data),
m_messageType(other.m_messageType){}
void ActivityLogEntryStartMessage::replaceData(ActivityLogEntryStartMessage &other) {
m_data = other.m_data;
m_messageType = other.m_messageType;
}
ActivityLogEntryStartMessage ActivityLogEntryStartMessage::fromJson(QJsonObject source) {
ActivityLogEntryStartMessage instance;
instance.setFromJson(source);
return instance;
}
void ActivityLogEntryStartMessage::setFromJson(QJsonObject source) {
m_data = Jellyfin::Support::fromJsonValue<QString>(source["Data"]);
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject ActivityLogEntryStartMessage::toJson() const {
QJsonObject result;
if (!(m_data.isNull())) {
result["Data"] = Jellyfin::Support::toJsonValue<QString>(m_data);
}
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
QString ActivityLogEntryStartMessage::data() const { return m_data; }
void ActivityLogEntryStartMessage::setData(QString newData) {
m_data = newData;
}
bool ActivityLogEntryStartMessage::dataNull() const {
return m_data.isNull();
}
void ActivityLogEntryStartMessage::setDataNull() {
m_data.clear();
}
SessionMessageType ActivityLogEntryStartMessage::messageType() const { return m_messageType; }
void ActivityLogEntryStartMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using ActivityLogEntryStartMessage = Jellyfin::DTO::ActivityLogEntryStartMessage;
template <>
ActivityLogEntryStartMessage fromJsonValue(const QJsonValue &source, convertType<ActivityLogEntryStartMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ActivityLogEntryStartMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ActivityLogEntryStartMessage &source, convertType<ActivityLogEntryStartMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,96 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/activitylogentrystopmessage.h>
namespace Jellyfin {
namespace DTO {
ActivityLogEntryStopMessage::ActivityLogEntryStopMessage() {}
ActivityLogEntryStopMessage::ActivityLogEntryStopMessage (
SessionMessageType messageType
) :
m_messageType(messageType) { }
ActivityLogEntryStopMessage::ActivityLogEntryStopMessage(const ActivityLogEntryStopMessage &other) :
m_messageType(other.m_messageType){}
void ActivityLogEntryStopMessage::replaceData(ActivityLogEntryStopMessage &other) {
m_messageType = other.m_messageType;
}
ActivityLogEntryStopMessage ActivityLogEntryStopMessage::fromJson(QJsonObject source) {
ActivityLogEntryStopMessage instance;
instance.setFromJson(source);
return instance;
}
void ActivityLogEntryStopMessage::setFromJson(QJsonObject source) {
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject ActivityLogEntryStopMessage::toJson() const {
QJsonObject result;
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
SessionMessageType ActivityLogEntryStopMessage::messageType() const { return m_messageType; }
void ActivityLogEntryStopMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using ActivityLogEntryStopMessage = Jellyfin::DTO::ActivityLogEntryStopMessage;
template <>
ActivityLogEntryStopMessage fromJsonValue(const QJsonValue &source, convertType<ActivityLogEntryStopMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ActivityLogEntryStopMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ActivityLogEntryStopMessage &source, convertType<ActivityLogEntryStopMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,15 +34,22 @@ namespace DTO {
AlbumInfo::AlbumInfo() {}
AlbumInfo::AlbumInfo (
bool isAutomated
bool isAutomated,
QStringList albumArtists,
QJsonObject artistProviderIds,
QList<SongInfo> songInfos
) :
m_isAutomated(isAutomated) { }
m_isAutomated(isAutomated),
m_albumArtists(albumArtists),
m_artistProviderIds(artistProviderIds),
m_songInfos(songInfos) { }
AlbumInfo::AlbumInfo(const AlbumInfo &other) :
m_name(other.m_name),
m_originalTitle(other.m_originalTitle),
m_path(other.m_path),
m_metadataLanguage(other.m_metadataLanguage),
m_metadataCountryCode(other.m_metadataCountryCode),
@ -59,6 +66,7 @@ AlbumInfo::AlbumInfo(const AlbumInfo &other) :
void AlbumInfo::replaceData(AlbumInfo &other) {
m_name = other.m_name;
m_originalTitle = other.m_originalTitle;
m_path = other.m_path;
m_metadataLanguage = other.m_metadataLanguage;
m_metadataCountryCode = other.m_metadataCountryCode;
@ -82,6 +90,7 @@ AlbumInfo AlbumInfo::fromJson(QJsonObject source) {
void AlbumInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_originalTitle = Jellyfin::Support::fromJsonValue<QString>(source["OriginalTitle"]);
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
@ -106,6 +115,11 @@ QJsonObject AlbumInfo::toJson() const {
}
if (!(m_originalTitle.isNull())) {
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
@ -146,21 +160,9 @@ QJsonObject AlbumInfo::toJson() const {
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
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);
}
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);
return result;
}
@ -176,6 +178,19 @@ bool AlbumInfo::nameNull() const {
void AlbumInfo::setNameNull() {
m_name.clear();
}
QString AlbumInfo::originalTitle() const { return m_originalTitle; }
void AlbumInfo::setOriginalTitle(QString newOriginalTitle) {
m_originalTitle = newOriginalTitle;
}
bool AlbumInfo::originalTitleNull() const {
return m_originalTitle.isNull();
}
void AlbumInfo::setOriginalTitleNull() {
m_originalTitle.clear();
}
QString AlbumInfo::path() const { return m_path; }
@ -292,40 +307,19 @@ QStringList AlbumInfo::albumArtists() const { return m_albumArtists; }
void AlbumInfo::setAlbumArtists(QStringList newAlbumArtists) {
m_albumArtists = newAlbumArtists;
}
bool AlbumInfo::albumArtistsNull() const {
return m_albumArtists.size() == 0;
}
void AlbumInfo::setAlbumArtistsNull() {
m_albumArtists.clear();
}
QJsonObject AlbumInfo::artistProviderIds() const { return m_artistProviderIds; }
void AlbumInfo::setArtistProviderIds(QJsonObject newArtistProviderIds) {
m_artistProviderIds = newArtistProviderIds;
}
bool AlbumInfo::artistProviderIdsNull() const {
return m_artistProviderIds.isEmpty();
}
void AlbumInfo::setArtistProviderIdsNull() {
m_artistProviderIds= QJsonObject();
}
QList<SongInfo> AlbumInfo::songInfos() const { return m_songInfos; }
void AlbumInfo::setSongInfos(QList<SongInfo> newSongInfos) {
m_songInfos = newSongInfos;
}
bool AlbumInfo::songInfosNull() const {
return m_songInfos.size() == 0;
}
void AlbumInfo::setSongInfosNull() {
m_songInfos.clear();
}
} // NS DTO

View file

@ -34,15 +34,18 @@ namespace DTO {
ArtistInfo::ArtistInfo() {}
ArtistInfo::ArtistInfo (
bool isAutomated
bool isAutomated,
QList<SongInfo> songInfos
) :
m_isAutomated(isAutomated) { }
m_isAutomated(isAutomated),
m_songInfos(songInfos) { }
ArtistInfo::ArtistInfo(const ArtistInfo &other) :
m_name(other.m_name),
m_originalTitle(other.m_originalTitle),
m_path(other.m_path),
m_metadataLanguage(other.m_metadataLanguage),
m_metadataCountryCode(other.m_metadataCountryCode),
@ -57,6 +60,7 @@ ArtistInfo::ArtistInfo(const ArtistInfo &other) :
void ArtistInfo::replaceData(ArtistInfo &other) {
m_name = other.m_name;
m_originalTitle = other.m_originalTitle;
m_path = other.m_path;
m_metadataLanguage = other.m_metadataLanguage;
m_metadataCountryCode = other.m_metadataCountryCode;
@ -78,6 +82,7 @@ ArtistInfo ArtistInfo::fromJson(QJsonObject source) {
void ArtistInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_originalTitle = Jellyfin::Support::fromJsonValue<QString>(source["OriginalTitle"]);
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
@ -100,6 +105,11 @@ QJsonObject ArtistInfo::toJson() const {
}
if (!(m_originalTitle.isNull())) {
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
@ -140,11 +150,7 @@ QJsonObject ArtistInfo::toJson() const {
}
result["IsAutomated"] = Jellyfin::Support::toJsonValue<bool>(m_isAutomated);
if (!(m_songInfos.size() == 0)) {
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<SongInfo>>(m_songInfos);
}
result["SongInfos"] = Jellyfin::Support::toJsonValue<QList<SongInfo>>(m_songInfos);
return result;
}
@ -160,6 +166,19 @@ bool ArtistInfo::nameNull() const {
void ArtistInfo::setNameNull() {
m_name.clear();
}
QString ArtistInfo::originalTitle() const { return m_originalTitle; }
void ArtistInfo::setOriginalTitle(QString newOriginalTitle) {
m_originalTitle = newOriginalTitle;
}
bool ArtistInfo::originalTitleNull() const {
return m_originalTitle.isNull();
}
void ArtistInfo::setOriginalTitleNull() {
m_originalTitle.clear();
}
QString ArtistInfo::path() const { return m_path; }
@ -276,14 +295,7 @@ QList<SongInfo> ArtistInfo::songInfos() const { return m_songInfos; }
void ArtistInfo::setSongInfos(QList<SongInfo> newSongInfos) {
m_songInfos = newSongInfos;
}
bool ArtistInfo::songInfosNull() const {
return m_songInfos.size() == 0;
}
void ArtistInfo::setSongInfosNull() {
m_songInfos.clear();
}
} // NS DTO

View file

@ -27,43 +27,48 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/configurationpagetype.h>
#include <JellyfinQt/dto/audiospatialformat.h>
namespace Jellyfin {
namespace DTO {
ConfigurationPageTypeClass::ConfigurationPageTypeClass() {}
AudioSpatialFormatClass::AudioSpatialFormatClass() {}
} // NS DTO
namespace Support {
using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType;
using AudioSpatialFormat = Jellyfin::DTO::AudioSpatialFormat;
template <>
ConfigurationPageType fromJsonValue(const QJsonValue &source, convertType<ConfigurationPageType>) {
if (!source.isString()) return ConfigurationPageType::EnumNotSet;
AudioSpatialFormat fromJsonValue(const QJsonValue &source, convertType<AudioSpatialFormat>) {
if (!source.isString()) return AudioSpatialFormat::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("PluginConfiguration")) {
return ConfigurationPageType::PluginConfiguration;
}
if (str == QStringLiteral("None")) {
return ConfigurationPageType::None;
return AudioSpatialFormat::None;
}
if (str == QStringLiteral("DolbyAtmos")) {
return AudioSpatialFormat::DolbyAtmos;
}
if (str == QStringLiteral("DTSX")) {
return AudioSpatialFormat::DTSX;
}
return ConfigurationPageType::EnumNotSet;
return AudioSpatialFormat::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const ConfigurationPageType &source, convertType<ConfigurationPageType>) {
QJsonValue toJsonValue(const AudioSpatialFormat &source, convertType<AudioSpatialFormat>) {
switch(source) {
case ConfigurationPageType::PluginConfiguration:
return QStringLiteral("PluginConfiguration");
case ConfigurationPageType::None:
case AudioSpatialFormat::None:
return QStringLiteral("None");
case AudioSpatialFormat::DolbyAtmos:
return QStringLiteral("DolbyAtmos");
case AudioSpatialFormat::DTSX:
return QStringLiteral("DTSX");
case ConfigurationPageType::EnumNotSet: // Fallthrough
case AudioSpatialFormat::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}

View file

@ -37,14 +37,12 @@ AuthenticateUserByName::AuthenticateUserByName() {}
AuthenticateUserByName::AuthenticateUserByName(const AuthenticateUserByName &other) :
m_username(other.m_username),
m_pw(other.m_pw),
m_password(other.m_password){}
m_pw(other.m_pw){}
void AuthenticateUserByName::replaceData(AuthenticateUserByName &other) {
m_username = other.m_username;
m_pw = other.m_pw;
m_password = other.m_password;
}
AuthenticateUserByName AuthenticateUserByName::fromJson(QJsonObject source) {
@ -57,7 +55,6 @@ AuthenticateUserByName AuthenticateUserByName::fromJson(QJsonObject source) {
void AuthenticateUserByName::setFromJson(QJsonObject source) {
m_username = Jellyfin::Support::fromJsonValue<QString>(source["Username"]);
m_pw = Jellyfin::Support::fromJsonValue<QString>(source["Pw"]);
m_password = Jellyfin::Support::fromJsonValue<QString>(source["Password"]);
}
@ -73,11 +70,6 @@ QJsonObject AuthenticateUserByName::toJson() const {
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;
}
@ -107,19 +99,6 @@ bool AuthenticateUserByName::pwNull() const {
void AuthenticateUserByName::setPwNull() {
m_pw.clear();
}
QString AuthenticateUserByName::password() const { return m_password; }
void AuthenticateUserByName::setPassword(QString newPassword) {
m_password = newPassword;
}
bool AuthenticateUserByName::passwordNull() const {
return m_password.isNull();
}
void AuthenticateUserByName::setPasswordNull() {
m_password.clear();
}
} // NS DTO

View file

@ -34,9 +34,11 @@ namespace DTO {
AuthenticationInfoQueryResult::AuthenticationInfoQueryResult() {}
AuthenticationInfoQueryResult::AuthenticationInfoQueryResult (
QList<AuthenticationInfo> items,
qint32 totalRecordCount,
qint32 startIndex
) :
m_items(items),
m_totalRecordCount(totalRecordCount),
m_startIndex(startIndex) { }
@ -72,11 +74,7 @@ void AuthenticationInfoQueryResult::setFromJson(QJsonObject source) {
QJsonObject AuthenticationInfoQueryResult::toJson() const {
QJsonObject result;
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<AuthenticationInfo>>(m_items);
}
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;
@ -87,14 +85,7 @@ QList<AuthenticationInfo> AuthenticationInfoQueryResult::items() const { return
void AuthenticationInfoQueryResult::setItems(QList<AuthenticationInfo> newItems) {
m_items = newItems;
}
bool AuthenticationInfoQueryResult::itemsNull() const {
return m_items.size() == 0;
}
void AuthenticationInfoQueryResult::setItemsNull() {
m_items.clear();
}
qint32 AuthenticationInfoQueryResult::totalRecordCount() const { return m_totalRecordCount; }
void AuthenticationInfoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {

View file

@ -35,7 +35,7 @@ namespace DTO {
AuthenticationResult::AuthenticationResult() {}
AuthenticationResult::AuthenticationResult (
QSharedPointer<UserDto> user,
QSharedPointer<SessionInfo> sessionInfo
QSharedPointer<SessionInfoDto> sessionInfo
) :
m_user(user),
m_sessionInfo(sessionInfo) { }
@ -66,7 +66,7 @@ AuthenticationResult AuthenticationResult::fromJson(QJsonObject source) {
void AuthenticationResult::setFromJson(QJsonObject source) {
m_user = Jellyfin::Support::fromJsonValue<QSharedPointer<UserDto>>(source["User"]);
m_sessionInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<SessionInfo>>(source["SessionInfo"]);
m_sessionInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<SessionInfoDto>>(source["SessionInfo"]);
m_accessToken = Jellyfin::Support::fromJsonValue<QString>(source["AccessToken"]);
m_serverId = Jellyfin::Support::fromJsonValue<QString>(source["ServerId"]);
@ -76,7 +76,7 @@ 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["SessionInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<SessionInfoDto>>(m_sessionInfo);
if (!(m_accessToken.isNull())) {
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
@ -96,9 +96,9 @@ void AuthenticationResult::setUser(QSharedPointer<UserDto> newUser) {
m_user = newUser;
}
QSharedPointer<SessionInfo> AuthenticationResult::sessionInfo() const { return m_sessionInfo; }
QSharedPointer<SessionInfoDto> AuthenticationResult::sessionInfo() const { return m_sessionInfo; }
void AuthenticationResult::setSessionInfo(QSharedPointer<SessionInfo> newSessionInfo) {
void AuthenticationResult::setSessionInfo(QSharedPointer<SessionInfoDto> newSessionInfo) {
m_sessionInfo = newSessionInfo;
}

View file

@ -1,261 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/baseitem.h>
namespace Jellyfin {
namespace DTO {
BaseItem::BaseItem() {}
BaseItem::BaseItem (
QDateTime dateLastSaved,
bool isHD,
bool isShortcut,
qint32 width,
qint32 height,
bool supportsExternalTransfer
) :
m_dateLastSaved(dateLastSaved),
m_isHD(isHD),
m_isShortcut(isShortcut),
m_width(width),
m_height(height),
m_supportsExternalTransfer(supportsExternalTransfer) { }
BaseItem::BaseItem(const BaseItem &other) :
m_size(other.m_size),
m_container(other.m_container),
m_dateLastSaved(other.m_dateLastSaved),
m_remoteTrailers(other.m_remoteTrailers),
m_isHD(other.m_isHD),
m_isShortcut(other.m_isShortcut),
m_shortcutPath(other.m_shortcutPath),
m_width(other.m_width),
m_height(other.m_height),
m_extraIds(other.m_extraIds),
m_supportsExternalTransfer(other.m_supportsExternalTransfer){}
void BaseItem::replaceData(BaseItem &other) {
m_size = other.m_size;
m_container = other.m_container;
m_dateLastSaved = other.m_dateLastSaved;
m_remoteTrailers = other.m_remoteTrailers;
m_isHD = other.m_isHD;
m_isShortcut = other.m_isShortcut;
m_shortcutPath = other.m_shortcutPath;
m_width = other.m_width;
m_height = other.m_height;
m_extraIds = other.m_extraIds;
m_supportsExternalTransfer = other.m_supportsExternalTransfer;
}
BaseItem BaseItem::fromJson(QJsonObject source) {
BaseItem instance;
instance.setFromJson(source);
return instance;
}
void BaseItem::setFromJson(QJsonObject source) {
m_size = Jellyfin::Support::fromJsonValue<std::optional<qint64>>(source["Size"]);
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
m_dateLastSaved = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastSaved"]);
m_remoteTrailers = Jellyfin::Support::fromJsonValue<QList<MediaUrl>>(source["RemoteTrailers"]);
m_isHD = Jellyfin::Support::fromJsonValue<bool>(source["IsHD"]);
m_isShortcut = Jellyfin::Support::fromJsonValue<bool>(source["IsShortcut"]);
m_shortcutPath = Jellyfin::Support::fromJsonValue<QString>(source["ShortcutPath"]);
m_width = Jellyfin::Support::fromJsonValue<qint32>(source["Width"]);
m_height = Jellyfin::Support::fromJsonValue<qint32>(source["Height"]);
m_extraIds = Jellyfin::Support::fromJsonValue<QStringList>(source["ExtraIds"]);
m_supportsExternalTransfer = Jellyfin::Support::fromJsonValue<bool>(source["SupportsExternalTransfer"]);
}
QJsonObject BaseItem::toJson() const {
QJsonObject result;
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);
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);
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);
if (!(m_extraIds.size() == 0)) {
result["ExtraIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_extraIds);
}
result["SupportsExternalTransfer"] = Jellyfin::Support::toJsonValue<bool>(m_supportsExternalTransfer);
return result;
}
std::optional<qint64> BaseItem::size() const { return m_size; }
void BaseItem::setSize(std::optional<qint64> newSize) {
m_size = newSize;
}
bool BaseItem::sizeNull() const {
return !m_size.has_value();
}
void BaseItem::setSizeNull() {
m_size = std::nullopt;
}
QString BaseItem::container() const { return m_container; }
void BaseItem::setContainer(QString newContainer) {
m_container = newContainer;
}
bool BaseItem::containerNull() const {
return m_container.isNull();
}
void BaseItem::setContainerNull() {
m_container.clear();
}
QDateTime BaseItem::dateLastSaved() const { return m_dateLastSaved; }
void BaseItem::setDateLastSaved(QDateTime newDateLastSaved) {
m_dateLastSaved = newDateLastSaved;
}
QList<MediaUrl> BaseItem::remoteTrailers() const { return m_remoteTrailers; }
void BaseItem::setRemoteTrailers(QList<MediaUrl> newRemoteTrailers) {
m_remoteTrailers = newRemoteTrailers;
}
bool BaseItem::remoteTrailersNull() const {
return m_remoteTrailers.size() == 0;
}
void BaseItem::setRemoteTrailersNull() {
m_remoteTrailers.clear();
}
bool BaseItem::isHD() const { return m_isHD; }
void BaseItem::setIsHD(bool newIsHD) {
m_isHD = newIsHD;
}
bool BaseItem::isShortcut() const { return m_isShortcut; }
void BaseItem::setIsShortcut(bool newIsShortcut) {
m_isShortcut = newIsShortcut;
}
QString BaseItem::shortcutPath() const { return m_shortcutPath; }
void BaseItem::setShortcutPath(QString newShortcutPath) {
m_shortcutPath = newShortcutPath;
}
bool BaseItem::shortcutPathNull() const {
return m_shortcutPath.isNull();
}
void BaseItem::setShortcutPathNull() {
m_shortcutPath.clear();
}
qint32 BaseItem::width() const { return m_width; }
void BaseItem::setWidth(qint32 newWidth) {
m_width = newWidth;
}
qint32 BaseItem::height() const { return m_height; }
void BaseItem::setHeight(qint32 newHeight) {
m_height = newHeight;
}
QStringList BaseItem::extraIds() const { return m_extraIds; }
void BaseItem::setExtraIds(QStringList newExtraIds) {
m_extraIds = newExtraIds;
}
bool BaseItem::extraIdsNull() const {
return m_extraIds.size() == 0;
}
void BaseItem::setExtraIdsNull() {
m_extraIds.clear();
}
bool BaseItem::supportsExternalTransfer() const { return m_supportsExternalTransfer; }
void BaseItem::setSupportsExternalTransfer(bool newSupportsExternalTransfer) {
m_supportsExternalTransfer = newSupportsExternalTransfer;
}
} // NS DTO
namespace Support {
using BaseItem = Jellyfin::DTO::BaseItem;
template <>
BaseItem fromJsonValue(const QJsonValue &source, convertType<BaseItem>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return BaseItem::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const BaseItem &source, convertType<BaseItem>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -35,24 +35,32 @@ namespace DTO {
BaseItemDto::BaseItemDto() {}
BaseItemDto::BaseItemDto (
QString jellyfinId,
ExtraType extraType,
Video3DFormat video3DFormat,
PlayAccess playAccess,
BaseItemKind type,
QSharedPointer<UserItemDataDto> userData,
CollectionType collectionType,
VideoType videoType,
LocationType locationType,
IsoType isoType,
MediaType mediaType,
ImageOrientation imageOrientation,
ChannelType channelType,
ProgramAudio audio,
QSharedPointer<BaseItemDto> currentProgram
) :
m_jellyfinId(jellyfinId),
m_extraType(extraType),
m_video3DFormat(video3DFormat),
m_playAccess(playAccess),
m_type(type),
m_userData(userData),
m_collectionType(collectionType),
m_videoType(videoType),
m_locationType(locationType),
m_isoType(isoType),
m_mediaType(mediaType),
m_imageOrientation(imageOrientation),
m_channelType(channelType),
m_audio(audio),
@ -77,10 +85,10 @@ BaseItemDto::BaseItemDto(const BaseItemDto &other) :
m_airsBeforeEpisodeNumber(other.m_airsBeforeEpisodeNumber),
m_canDelete(other.m_canDelete),
m_canDownload(other.m_canDownload),
m_hasLyrics(other.m_hasLyrics),
m_hasSubtitles(other.m_hasSubtitles),
m_preferredMetadataLanguage(other.m_preferredMetadataLanguage),
m_preferredMetadataCountryCode(other.m_preferredMetadataCountryCode),
m_supportsSync(other.m_supportsSync),
m_container(other.m_container),
m_sortName(other.m_sortName),
m_forcedSortName(other.m_forcedSortName),
@ -166,6 +174,7 @@ BaseItemDto::BaseItemDto(const BaseItemDto &other) :
m_parentPrimaryImageItemId(other.m_parentPrimaryImageItemId),
m_parentPrimaryImageTag(other.m_parentPrimaryImageTag),
m_chapters(other.m_chapters),
m_trickplay(other.m_trickplay),
m_locationType(other.m_locationType),
m_isoType(other.m_isoType),
m_mediaType(other.m_mediaType),
@ -212,6 +221,7 @@ BaseItemDto::BaseItemDto(const BaseItemDto &other) :
m_isKids(other.m_isKids),
m_isPremiere(other.m_isPremiere),
m_timerId(other.m_timerId),
m_normalizationGain(other.m_normalizationGain),
m_currentProgram(other.m_currentProgram){}
@ -231,10 +241,10 @@ void BaseItemDto::replaceData(BaseItemDto &other) {
m_airsBeforeEpisodeNumber = other.m_airsBeforeEpisodeNumber;
m_canDelete = other.m_canDelete;
m_canDownload = other.m_canDownload;
m_hasLyrics = other.m_hasLyrics;
m_hasSubtitles = other.m_hasSubtitles;
m_preferredMetadataLanguage = other.m_preferredMetadataLanguage;
m_preferredMetadataCountryCode = other.m_preferredMetadataCountryCode;
m_supportsSync = other.m_supportsSync;
m_container = other.m_container;
m_sortName = other.m_sortName;
m_forcedSortName = other.m_forcedSortName;
@ -320,6 +330,7 @@ void BaseItemDto::replaceData(BaseItemDto &other) {
m_parentPrimaryImageItemId = other.m_parentPrimaryImageItemId;
m_parentPrimaryImageTag = other.m_parentPrimaryImageTag;
m_chapters = other.m_chapters;
m_trickplay = other.m_trickplay;
m_locationType = other.m_locationType;
m_isoType = other.m_isoType;
m_mediaType = other.m_mediaType;
@ -366,6 +377,7 @@ void BaseItemDto::replaceData(BaseItemDto &other) {
m_isKids = other.m_isKids;
m_isPremiere = other.m_isPremiere;
m_timerId = other.m_timerId;
m_normalizationGain = other.m_normalizationGain;
m_currentProgram = other.m_currentProgram;
}
@ -386,16 +398,16 @@ void BaseItemDto::setFromJson(QJsonObject source) {
m_playlistItemId = Jellyfin::Support::fromJsonValue<QString>(source["PlaylistItemId"]);
m_dateCreated = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateCreated"]);
m_dateLastMediaAdded = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastMediaAdded"]);
m_extraType = Jellyfin::Support::fromJsonValue<QString>(source["ExtraType"]);
m_extraType = Jellyfin::Support::fromJsonValue<ExtraType>(source["ExtraType"]);
m_airsBeforeSeasonNumber = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["AirsBeforeSeasonNumber"]);
m_airsAfterSeasonNumber = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["AirsAfterSeasonNumber"]);
m_airsBeforeEpisodeNumber = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["AirsBeforeEpisodeNumber"]);
m_canDelete = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["CanDelete"]);
m_canDownload = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["CanDownload"]);
m_hasLyrics = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["HasLyrics"]);
m_hasSubtitles = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["HasSubtitles"]);
m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["PreferredMetadataLanguage"]);
m_preferredMetadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["PreferredMetadataCountryCode"]);
m_supportsSync = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["SupportsSync"]);
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
m_sortName = Jellyfin::Support::fromJsonValue<QString>(source["SortName"]);
m_forcedSortName = Jellyfin::Support::fromJsonValue<QString>(source["ForcedSortName"]);
@ -431,7 +443,7 @@ void BaseItemDto::setFromJson(QJsonObject source) {
m_isHD = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsHD"]);
m_isFolder = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsFolder"]);
m_parentId = Jellyfin::Support::fromJsonValue<QString>(source["ParentId"]);
m_type = Jellyfin::Support::fromJsonValue<QString>(source["Type"]);
m_type = Jellyfin::Support::fromJsonValue<BaseItemKind>(source["Type"]);
m_people = Jellyfin::Support::fromJsonValue<QList<BaseItemPerson>>(source["People"]);
m_studios = Jellyfin::Support::fromJsonValue<QList<NameGuidPair>>(source["Studios"]);
m_genreItems = Jellyfin::Support::fromJsonValue<QList<NameGuidPair>>(source["GenreItems"]);
@ -455,7 +467,7 @@ void BaseItemDto::setFromJson(QJsonObject source) {
m_artists = Jellyfin::Support::fromJsonValue<QStringList>(source["Artists"]);
m_artistItems = Jellyfin::Support::fromJsonValue<QList<NameGuidPair>>(source["ArtistItems"]);
m_album = Jellyfin::Support::fromJsonValue<QString>(source["Album"]);
m_collectionType = Jellyfin::Support::fromJsonValue<QString>(source["CollectionType"]);
m_collectionType = Jellyfin::Support::fromJsonValue<CollectionType>(source["CollectionType"]);
m_displayOrder = Jellyfin::Support::fromJsonValue<QString>(source["DisplayOrder"]);
m_albumId = Jellyfin::Support::fromJsonValue<QString>(source["AlbumId"]);
m_albumPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["AlbumPrimaryImageTag"]);
@ -481,9 +493,10 @@ void BaseItemDto::setFromJson(QJsonObject source) {
m_parentPrimaryImageItemId = Jellyfin::Support::fromJsonValue<QString>(source["ParentPrimaryImageItemId"]);
m_parentPrimaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["ParentPrimaryImageTag"]);
m_chapters = Jellyfin::Support::fromJsonValue<QList<ChapterInfo>>(source["Chapters"]);
m_trickplay = Jellyfin::Support::fromJsonValue<QJsonObject>(source["Trickplay"]);
m_locationType = Jellyfin::Support::fromJsonValue<LocationType>(source["LocationType"]);
m_isoType = Jellyfin::Support::fromJsonValue<IsoType>(source["IsoType"]);
m_mediaType = Jellyfin::Support::fromJsonValue<QString>(source["MediaType"]);
m_mediaType = Jellyfin::Support::fromJsonValue<MediaType>(source["MediaType"]);
m_endDate = Jellyfin::Support::fromJsonValue<QDateTime>(source["EndDate"]);
m_lockedFields = Jellyfin::Support::fromJsonValue<QList<MetadataField>>(source["LockedFields"]);
m_trailerCount = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["TrailerCount"]);
@ -527,6 +540,7 @@ void BaseItemDto::setFromJson(QJsonObject source) {
m_isKids = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsKids"]);
m_isPremiere = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsPremiere"]);
m_timerId = Jellyfin::Support::fromJsonValue<QString>(source["TimerId"]);
m_normalizationGain = Jellyfin::Support::fromJsonValue<std::optional<float>>(source["NormalizationGain"]);
m_currentProgram = Jellyfin::Support::fromJsonValue<QSharedPointer<BaseItemDto>>(source["CurrentProgram"]);
}
@ -575,11 +589,7 @@ QJsonObject BaseItemDto::toJson() const {
result["DateLastMediaAdded"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastMediaAdded);
}
if (!(m_extraType.isNull())) {
result["ExtraType"] = Jellyfin::Support::toJsonValue<QString>(m_extraType);
}
result["ExtraType"] = Jellyfin::Support::toJsonValue<ExtraType>(m_extraType);
if (!(!m_airsBeforeSeasonNumber.has_value())) {
result["AirsBeforeSeasonNumber"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_airsBeforeSeasonNumber);
@ -606,6 +616,11 @@ QJsonObject BaseItemDto::toJson() const {
}
if (!(!m_hasLyrics.has_value())) {
result["HasLyrics"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasLyrics);
}
if (!(!m_hasSubtitles.has_value())) {
result["HasSubtitles"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_hasSubtitles);
}
@ -621,11 +636,6 @@ QJsonObject BaseItemDto::toJson() const {
}
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);
}
@ -792,11 +802,7 @@ QJsonObject BaseItemDto::toJson() const {
result["ParentId"] = Jellyfin::Support::toJsonValue<QString>(m_parentId);
}
if (!(m_type.isNull())) {
result["Type"] = Jellyfin::Support::toJsonValue<QString>(m_type);
}
result["Type"] = Jellyfin::Support::toJsonValue<BaseItemKind>(m_type);
if (!(m_people.size() == 0)) {
result["People"] = Jellyfin::Support::toJsonValue<QList<BaseItemPerson>>(m_people);
@ -908,11 +914,7 @@ QJsonObject BaseItemDto::toJson() const {
result["Album"] = Jellyfin::Support::toJsonValue<QString>(m_album);
}
if (!(m_collectionType.isNull())) {
result["CollectionType"] = Jellyfin::Support::toJsonValue<QString>(m_collectionType);
}
result["CollectionType"] = Jellyfin::Support::toJsonValue<CollectionType>(m_collectionType);
if (!(m_displayOrder.isNull())) {
result["DisplayOrder"] = Jellyfin::Support::toJsonValue<QString>(m_displayOrder);
@ -1034,13 +1036,14 @@ QJsonObject BaseItemDto::toJson() const {
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);
if (!(m_mediaType.isNull())) {
result["MediaType"] = Jellyfin::Support::toJsonValue<QString>(m_mediaType);
if (!(m_trickplay.isEmpty())) {
result["Trickplay"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_trickplay);
}
result["LocationType"] = Jellyfin::Support::toJsonValue<LocationType>(m_locationType);
result["IsoType"] = Jellyfin::Support::toJsonValue<IsoType>(m_isoType);
result["MediaType"] = Jellyfin::Support::toJsonValue<MediaType>(m_mediaType);
if (!(m_endDate.isNull())) {
result["EndDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_endDate);
@ -1244,6 +1247,11 @@ QJsonObject BaseItemDto::toJson() const {
result["TimerId"] = Jellyfin::Support::toJsonValue<QString>(m_timerId);
}
if (!(!m_normalizationGain.has_value())) {
result["NormalizationGain"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_normalizationGain);
}
result["CurrentProgram"] = Jellyfin::Support::toJsonValue<QSharedPointer<BaseItemDto>>(m_currentProgram);
return result;
}
@ -1358,19 +1366,12 @@ void BaseItemDto::setDateLastMediaAddedNull() {
m_dateLastMediaAdded= QDateTime();
}
QString BaseItemDto::extraType() const { return m_extraType; }
ExtraType BaseItemDto::extraType() const { return m_extraType; }
void BaseItemDto::setExtraType(QString newExtraType) {
void BaseItemDto::setExtraType(ExtraType newExtraType) {
m_extraType = newExtraType;
}
bool BaseItemDto::extraTypeNull() const {
return m_extraType.isNull();
}
void BaseItemDto::setExtraTypeNull() {
m_extraType.clear();
}
std::optional<qint32> BaseItemDto::airsBeforeSeasonNumber() const { return m_airsBeforeSeasonNumber; }
void BaseItemDto::setAirsBeforeSeasonNumber(std::optional<qint32> newAirsBeforeSeasonNumber) {
@ -1435,6 +1436,19 @@ bool BaseItemDto::canDownloadNull() const {
void BaseItemDto::setCanDownloadNull() {
m_canDownload = std::nullopt;
}
std::optional<bool> BaseItemDto::hasLyrics() const { return m_hasLyrics; }
void BaseItemDto::setHasLyrics(std::optional<bool> newHasLyrics) {
m_hasLyrics = newHasLyrics;
}
bool BaseItemDto::hasLyricsNull() const {
return !m_hasLyrics.has_value();
}
void BaseItemDto::setHasLyricsNull() {
m_hasLyrics = std::nullopt;
}
std::optional<bool> BaseItemDto::hasSubtitles() const { return m_hasSubtitles; }
@ -1474,19 +1488,6 @@ bool BaseItemDto::preferredMetadataCountryCodeNull() const {
void BaseItemDto::setPreferredMetadataCountryCodeNull() {
m_preferredMetadataCountryCode.clear();
}
std::optional<bool> BaseItemDto::supportsSync() const { return m_supportsSync; }
void BaseItemDto::setSupportsSync(std::optional<bool> newSupportsSync) {
m_supportsSync = newSupportsSync;
}
bool BaseItemDto::supportsSyncNull() const {
return !m_supportsSync.has_value();
}
void BaseItemDto::setSupportsSyncNull() {
m_supportsSync = std::nullopt;
}
QString BaseItemDto::container() const { return m_container; }
@ -1929,19 +1930,12 @@ void BaseItemDto::setParentIdNull() {
m_parentId.clear();
}
QString BaseItemDto::type() const { return m_type; }
BaseItemKind BaseItemDto::type() const { return m_type; }
void BaseItemDto::setType(QString newType) {
void BaseItemDto::setType(BaseItemKind newType) {
m_type = newType;
}
bool BaseItemDto::typeNull() const {
return m_type.isNull();
}
void BaseItemDto::setTypeNull() {
m_type.clear();
}
QList<BaseItemPerson> BaseItemDto::people() const { return m_people; }
void BaseItemDto::setPeople(QList<BaseItemPerson> newPeople) {
@ -2234,19 +2228,12 @@ void BaseItemDto::setAlbumNull() {
m_album.clear();
}
QString BaseItemDto::collectionType() const { return m_collectionType; }
CollectionType BaseItemDto::collectionType() const { return m_collectionType; }
void BaseItemDto::setCollectionType(QString newCollectionType) {
void BaseItemDto::setCollectionType(CollectionType newCollectionType) {
m_collectionType = newCollectionType;
}
bool BaseItemDto::collectionTypeNull() const {
return m_collectionType.isNull();
}
void BaseItemDto::setCollectionTypeNull() {
m_collectionType.clear();
}
QString BaseItemDto::displayOrder() const { return m_displayOrder; }
void BaseItemDto::setDisplayOrder(QString newDisplayOrder) {
@ -2564,6 +2551,19 @@ bool BaseItemDto::chaptersNull() const {
void BaseItemDto::setChaptersNull() {
m_chapters.clear();
}
QJsonObject BaseItemDto::trickplay() const { return m_trickplay; }
void BaseItemDto::setTrickplay(QJsonObject newTrickplay) {
m_trickplay = newTrickplay;
}
bool BaseItemDto::trickplayNull() const {
return m_trickplay.isEmpty();
}
void BaseItemDto::setTrickplayNull() {
m_trickplay= QJsonObject();
}
LocationType BaseItemDto::locationType() const { return m_locationType; }
@ -2577,19 +2577,12 @@ void BaseItemDto::setIsoType(IsoType newIsoType) {
m_isoType = newIsoType;
}
QString BaseItemDto::mediaType() const { return m_mediaType; }
MediaType BaseItemDto::mediaType() const { return m_mediaType; }
void BaseItemDto::setMediaType(QString newMediaType) {
void BaseItemDto::setMediaType(MediaType newMediaType) {
m_mediaType = newMediaType;
}
bool BaseItemDto::mediaTypeNull() const {
return m_mediaType.isNull();
}
void BaseItemDto::setMediaTypeNull() {
m_mediaType.clear();
}
QDateTime BaseItemDto::endDate() const { return m_endDate; }
void BaseItemDto::setEndDate(QDateTime newEndDate) {
@ -3127,6 +3120,19 @@ bool BaseItemDto::timerIdNull() const {
void BaseItemDto::setTimerIdNull() {
m_timerId.clear();
}
std::optional<float> BaseItemDto::normalizationGain() const { return m_normalizationGain; }
void BaseItemDto::setNormalizationGain(std::optional<float> newNormalizationGain) {
m_normalizationGain = newNormalizationGain;
}
bool BaseItemDto::normalizationGainNull() const {
return !m_normalizationGain.has_value();
}
void BaseItemDto::setNormalizationGainNull() {
m_normalizationGain = std::nullopt;
}
QSharedPointer<BaseItemDto> BaseItemDto::currentProgram() const { return m_currentProgram; }

View file

@ -34,9 +34,11 @@ namespace DTO {
BaseItemDtoQueryResult::BaseItemDtoQueryResult() {}
BaseItemDtoQueryResult::BaseItemDtoQueryResult (
QList<BaseItemDto> items,
qint32 totalRecordCount,
qint32 startIndex
) :
m_items(items),
m_totalRecordCount(totalRecordCount),
m_startIndex(startIndex) { }
@ -72,11 +74,7 @@ void BaseItemDtoQueryResult::setFromJson(QJsonObject source) {
QJsonObject BaseItemDtoQueryResult::toJson() const {
QJsonObject result;
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<BaseItemDto>>(m_items);
}
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;
@ -87,14 +85,7 @@ QList<BaseItemDto> BaseItemDtoQueryResult::items() const { return m_items; }
void BaseItemDtoQueryResult::setItems(QList<BaseItemDto> newItems) {
m_items = newItems;
}
bool BaseItemDtoQueryResult::itemsNull() const {
return m_items.size() == 0;
}
void BaseItemDtoQueryResult::setItemsNull() {
m_items.clear();
}
qint32 BaseItemDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; }
void BaseItemDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {

View file

@ -0,0 +1,248 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/baseitemkind.h>
namespace Jellyfin {
namespace DTO {
BaseItemKindClass::BaseItemKindClass() {}
} // NS DTO
namespace Support {
using BaseItemKind = Jellyfin::DTO::BaseItemKind;
template <>
BaseItemKind fromJsonValue(const QJsonValue &source, convertType<BaseItemKind>) {
if (!source.isString()) return BaseItemKind::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("AggregateFolder")) {
return BaseItemKind::AggregateFolder;
}
if (str == QStringLiteral("Audio")) {
return BaseItemKind::Audio;
}
if (str == QStringLiteral("AudioBook")) {
return BaseItemKind::AudioBook;
}
if (str == QStringLiteral("BasePluginFolder")) {
return BaseItemKind::BasePluginFolder;
}
if (str == QStringLiteral("Book")) {
return BaseItemKind::Book;
}
if (str == QStringLiteral("BoxSet")) {
return BaseItemKind::BoxSet;
}
if (str == QStringLiteral("Channel")) {
return BaseItemKind::Channel;
}
if (str == QStringLiteral("ChannelFolderItem")) {
return BaseItemKind::ChannelFolderItem;
}
if (str == QStringLiteral("CollectionFolder")) {
return BaseItemKind::CollectionFolder;
}
if (str == QStringLiteral("Episode")) {
return BaseItemKind::Episode;
}
if (str == QStringLiteral("Folder")) {
return BaseItemKind::Folder;
}
if (str == QStringLiteral("Genre")) {
return BaseItemKind::Genre;
}
if (str == QStringLiteral("ManualPlaylistsFolder")) {
return BaseItemKind::ManualPlaylistsFolder;
}
if (str == QStringLiteral("Movie")) {
return BaseItemKind::Movie;
}
if (str == QStringLiteral("LiveTvChannel")) {
return BaseItemKind::LiveTvChannel;
}
if (str == QStringLiteral("LiveTvProgram")) {
return BaseItemKind::LiveTvProgram;
}
if (str == QStringLiteral("MusicAlbum")) {
return BaseItemKind::MusicAlbum;
}
if (str == QStringLiteral("MusicArtist")) {
return BaseItemKind::MusicArtist;
}
if (str == QStringLiteral("MusicGenre")) {
return BaseItemKind::MusicGenre;
}
if (str == QStringLiteral("MusicVideo")) {
return BaseItemKind::MusicVideo;
}
if (str == QStringLiteral("Person")) {
return BaseItemKind::Person;
}
if (str == QStringLiteral("Photo")) {
return BaseItemKind::Photo;
}
if (str == QStringLiteral("PhotoAlbum")) {
return BaseItemKind::PhotoAlbum;
}
if (str == QStringLiteral("Playlist")) {
return BaseItemKind::Playlist;
}
if (str == QStringLiteral("PlaylistsFolder")) {
return BaseItemKind::PlaylistsFolder;
}
if (str == QStringLiteral("Program")) {
return BaseItemKind::Program;
}
if (str == QStringLiteral("Recording")) {
return BaseItemKind::Recording;
}
if (str == QStringLiteral("Season")) {
return BaseItemKind::Season;
}
if (str == QStringLiteral("Series")) {
return BaseItemKind::Series;
}
if (str == QStringLiteral("Studio")) {
return BaseItemKind::Studio;
}
if (str == QStringLiteral("Trailer")) {
return BaseItemKind::Trailer;
}
if (str == QStringLiteral("TvChannel")) {
return BaseItemKind::TvChannel;
}
if (str == QStringLiteral("TvProgram")) {
return BaseItemKind::TvProgram;
}
if (str == QStringLiteral("UserRootFolder")) {
return BaseItemKind::UserRootFolder;
}
if (str == QStringLiteral("UserView")) {
return BaseItemKind::UserView;
}
if (str == QStringLiteral("Video")) {
return BaseItemKind::Video;
}
if (str == QStringLiteral("Year")) {
return BaseItemKind::Year;
}
return BaseItemKind::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const BaseItemKind &source, convertType<BaseItemKind>) {
switch(source) {
case BaseItemKind::AggregateFolder:
return QStringLiteral("AggregateFolder");
case BaseItemKind::Audio:
return QStringLiteral("Audio");
case BaseItemKind::AudioBook:
return QStringLiteral("AudioBook");
case BaseItemKind::BasePluginFolder:
return QStringLiteral("BasePluginFolder");
case BaseItemKind::Book:
return QStringLiteral("Book");
case BaseItemKind::BoxSet:
return QStringLiteral("BoxSet");
case BaseItemKind::Channel:
return QStringLiteral("Channel");
case BaseItemKind::ChannelFolderItem:
return QStringLiteral("ChannelFolderItem");
case BaseItemKind::CollectionFolder:
return QStringLiteral("CollectionFolder");
case BaseItemKind::Episode:
return QStringLiteral("Episode");
case BaseItemKind::Folder:
return QStringLiteral("Folder");
case BaseItemKind::Genre:
return QStringLiteral("Genre");
case BaseItemKind::ManualPlaylistsFolder:
return QStringLiteral("ManualPlaylistsFolder");
case BaseItemKind::Movie:
return QStringLiteral("Movie");
case BaseItemKind::LiveTvChannel:
return QStringLiteral("LiveTvChannel");
case BaseItemKind::LiveTvProgram:
return QStringLiteral("LiveTvProgram");
case BaseItemKind::MusicAlbum:
return QStringLiteral("MusicAlbum");
case BaseItemKind::MusicArtist:
return QStringLiteral("MusicArtist");
case BaseItemKind::MusicGenre:
return QStringLiteral("MusicGenre");
case BaseItemKind::MusicVideo:
return QStringLiteral("MusicVideo");
case BaseItemKind::Person:
return QStringLiteral("Person");
case BaseItemKind::Photo:
return QStringLiteral("Photo");
case BaseItemKind::PhotoAlbum:
return QStringLiteral("PhotoAlbum");
case BaseItemKind::Playlist:
return QStringLiteral("Playlist");
case BaseItemKind::PlaylistsFolder:
return QStringLiteral("PlaylistsFolder");
case BaseItemKind::Program:
return QStringLiteral("Program");
case BaseItemKind::Recording:
return QStringLiteral("Recording");
case BaseItemKind::Season:
return QStringLiteral("Season");
case BaseItemKind::Series:
return QStringLiteral("Series");
case BaseItemKind::Studio:
return QStringLiteral("Studio");
case BaseItemKind::Trailer:
return QStringLiteral("Trailer");
case BaseItemKind::TvChannel:
return QStringLiteral("TvChannel");
case BaseItemKind::TvProgram:
return QStringLiteral("TvProgram");
case BaseItemKind::UserRootFolder:
return QStringLiteral("UserRootFolder");
case BaseItemKind::UserView:
return QStringLiteral("UserView");
case BaseItemKind::Video:
return QStringLiteral("Video");
case BaseItemKind::Year:
return QStringLiteral("Year");
case BaseItemKind::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -33,6 +33,14 @@ namespace Jellyfin {
namespace DTO {
BaseItemPerson::BaseItemPerson() {}
BaseItemPerson::BaseItemPerson (
QString jellyfinId,
PersonKind type
) :
m_jellyfinId(jellyfinId),
m_type(type) { }
BaseItemPerson::BaseItemPerson(const BaseItemPerson &other) :
@ -64,7 +72,7 @@ void BaseItemPerson::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_role = Jellyfin::Support::fromJsonValue<QString>(source["Role"]);
m_type = Jellyfin::Support::fromJsonValue<QString>(source["Type"]);
m_type = Jellyfin::Support::fromJsonValue<PersonKind>(source["Type"]);
m_primaryImageTag = Jellyfin::Support::fromJsonValue<QString>(source["PrimaryImageTag"]);
m_imageBlurHashes = Jellyfin::Support::fromJsonValue<QJsonObject>(source["ImageBlurHashes"]);
@ -78,21 +86,13 @@ QJsonObject BaseItemPerson::toJson() const {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
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);
}
result["Type"] = Jellyfin::Support::toJsonValue<PersonKind>(m_type);
if (!(m_primaryImageTag.isNull())) {
result["PrimaryImageTag"] = Jellyfin::Support::toJsonValue<QString>(m_primaryImageTag);
@ -124,14 +124,7 @@ QString BaseItemPerson::jellyfinId() const { return m_jellyfinId; }
void BaseItemPerson::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
bool BaseItemPerson::jellyfinIdNull() const {
return m_jellyfinId.isNull();
}
void BaseItemPerson::setJellyfinIdNull() {
m_jellyfinId.clear();
}
QString BaseItemPerson::role() const { return m_role; }
void BaseItemPerson::setRole(QString newRole) {
@ -145,19 +138,12 @@ void BaseItemPerson::setRoleNull() {
m_role.clear();
}
QString BaseItemPerson::type() const { return m_type; }
PersonKind BaseItemPerson::type() const { return m_type; }
void BaseItemPerson::setType(QString newType) {
void BaseItemPerson::setType(PersonKind newType) {
m_type = newType;
}
bool BaseItemPerson::typeNull() const {
return m_type.isNull();
}
void BaseItemPerson::setTypeNull() {
m_type.clear();
}
QString BaseItemPerson::primaryImageTag() const { return m_primaryImageTag; }
void BaseItemPerson::setPrimaryImageTag(QString newPrimaryImageTag) {

View file

@ -43,6 +43,7 @@ BookInfo::BookInfo (
BookInfo::BookInfo(const BookInfo &other) :
m_name(other.m_name),
m_originalTitle(other.m_originalTitle),
m_path(other.m_path),
m_metadataLanguage(other.m_metadataLanguage),
m_metadataCountryCode(other.m_metadataCountryCode),
@ -57,6 +58,7 @@ BookInfo::BookInfo(const BookInfo &other) :
void BookInfo::replaceData(BookInfo &other) {
m_name = other.m_name;
m_originalTitle = other.m_originalTitle;
m_path = other.m_path;
m_metadataLanguage = other.m_metadataLanguage;
m_metadataCountryCode = other.m_metadataCountryCode;
@ -78,6 +80,7 @@ BookInfo BookInfo::fromJson(QJsonObject source) {
void BookInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_originalTitle = Jellyfin::Support::fromJsonValue<QString>(source["OriginalTitle"]);
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
@ -100,6 +103,11 @@ QJsonObject BookInfo::toJson() const {
}
if (!(m_originalTitle.isNull())) {
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
@ -160,6 +168,19 @@ bool BookInfo::nameNull() const {
void BookInfo::setNameNull() {
m_name.clear();
}
QString BookInfo::originalTitle() const { return m_originalTitle; }
void BookInfo::setOriginalTitle(QString newOriginalTitle) {
m_originalTitle = newOriginalTitle;
}
bool BookInfo::originalTitleNull() const {
return m_originalTitle.isNull();
}
void BookInfo::setOriginalTitleNull() {
m_originalTitle.clear();
}
QString BookInfo::path() const { return m_path; }

View file

@ -43,6 +43,7 @@ BoxSetInfo::BoxSetInfo (
BoxSetInfo::BoxSetInfo(const BoxSetInfo &other) :
m_name(other.m_name),
m_originalTitle(other.m_originalTitle),
m_path(other.m_path),
m_metadataLanguage(other.m_metadataLanguage),
m_metadataCountryCode(other.m_metadataCountryCode),
@ -56,6 +57,7 @@ BoxSetInfo::BoxSetInfo(const BoxSetInfo &other) :
void BoxSetInfo::replaceData(BoxSetInfo &other) {
m_name = other.m_name;
m_originalTitle = other.m_originalTitle;
m_path = other.m_path;
m_metadataLanguage = other.m_metadataLanguage;
m_metadataCountryCode = other.m_metadataCountryCode;
@ -76,6 +78,7 @@ BoxSetInfo BoxSetInfo::fromJson(QJsonObject source) {
void BoxSetInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_originalTitle = Jellyfin::Support::fromJsonValue<QString>(source["OriginalTitle"]);
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_metadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["MetadataLanguage"]);
m_metadataCountryCode = Jellyfin::Support::fromJsonValue<QString>(source["MetadataCountryCode"]);
@ -97,6 +100,11 @@ QJsonObject BoxSetInfo::toJson() const {
}
if (!(m_originalTitle.isNull())) {
result["OriginalTitle"] = Jellyfin::Support::toJsonValue<QString>(m_originalTitle);
}
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
@ -152,6 +160,19 @@ bool BoxSetInfo::nameNull() const {
void BoxSetInfo::setNameNull() {
m_name.clear();
}
QString BoxSetInfo::originalTitle() const { return m_originalTitle; }
void BoxSetInfo::setOriginalTitle(QString newOriginalTitle) {
m_originalTitle = newOriginalTitle;
}
bool BoxSetInfo::originalTitleNull() const {
return m_originalTitle.isNull();
}
void BoxSetInfo::setOriginalTitleNull() {
m_originalTitle.clear();
}
QString BoxSetInfo::path() const { return m_path; }

View file

@ -33,16 +33,24 @@ namespace Jellyfin {
namespace DTO {
BrandingOptions::BrandingOptions() {}
BrandingOptions::BrandingOptions (
bool splashscreenEnabled
) :
m_splashscreenEnabled(splashscreenEnabled) { }
BrandingOptions::BrandingOptions(const BrandingOptions &other) :
m_loginDisclaimer(other.m_loginDisclaimer),
m_customCss(other.m_customCss){}
m_customCss(other.m_customCss),
m_splashscreenEnabled(other.m_splashscreenEnabled){}
void BrandingOptions::replaceData(BrandingOptions &other) {
m_loginDisclaimer = other.m_loginDisclaimer;
m_customCss = other.m_customCss;
m_splashscreenEnabled = other.m_splashscreenEnabled;
}
BrandingOptions BrandingOptions::fromJson(QJsonObject source) {
@ -55,6 +63,7 @@ BrandingOptions BrandingOptions::fromJson(QJsonObject source) {
void BrandingOptions::setFromJson(QJsonObject source) {
m_loginDisclaimer = Jellyfin::Support::fromJsonValue<QString>(source["LoginDisclaimer"]);
m_customCss = Jellyfin::Support::fromJsonValue<QString>(source["CustomCss"]);
m_splashscreenEnabled = Jellyfin::Support::fromJsonValue<bool>(source["SplashscreenEnabled"]);
}
@ -70,7 +79,8 @@ QJsonObject BrandingOptions::toJson() const {
if (!(m_customCss.isNull())) {
result["CustomCss"] = Jellyfin::Support::toJsonValue<QString>(m_customCss);
}
result["SplashscreenEnabled"] = Jellyfin::Support::toJsonValue<bool>(m_splashscreenEnabled);
return result;
}
@ -100,6 +110,12 @@ void BrandingOptions::setCustomCssNull() {
m_customCss.clear();
}
bool BrandingOptions::splashscreenEnabled() const { return m_splashscreenEnabled; }
void BrandingOptions::setSplashscreenEnabled(bool newSplashscreenEnabled) {
m_splashscreenEnabled = newSplashscreenEnabled;
}
} // NS DTO

View file

@ -27,94 +27,80 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/xmlattribute.h>
#include <JellyfinQt/dto/castreceiverapplication.h>
namespace Jellyfin {
namespace DTO {
XmlAttribute::XmlAttribute() {}
XmlAttribute::XmlAttribute(const XmlAttribute &other) :
m_name(other.m_name),
m_value(other.m_value){}
CastReceiverApplication::CastReceiverApplication() {}
CastReceiverApplication::CastReceiverApplication (
QString jellyfinId,
QString name
) :
m_jellyfinId(jellyfinId),
m_name(name) { }
void XmlAttribute::replaceData(XmlAttribute &other) {
CastReceiverApplication::CastReceiverApplication(const CastReceiverApplication &other) :
m_jellyfinId(other.m_jellyfinId),
m_name(other.m_name){}
void CastReceiverApplication::replaceData(CastReceiverApplication &other) {
m_jellyfinId = other.m_jellyfinId;
m_name = other.m_name;
m_value = other.m_value;
}
XmlAttribute XmlAttribute::fromJson(QJsonObject source) {
XmlAttribute instance;
CastReceiverApplication CastReceiverApplication::fromJson(QJsonObject source) {
CastReceiverApplication instance;
instance.setFromJson(source);
return instance;
}
void XmlAttribute::setFromJson(QJsonObject source) {
void CastReceiverApplication::setFromJson(QJsonObject source) {
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_value = Jellyfin::Support::fromJsonValue<QString>(source["Value"]);
}
QJsonObject XmlAttribute::toJson() const {
QJsonObject CastReceiverApplication::toJson() const {
QJsonObject result;
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["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
return result;
}
QString XmlAttribute::name() const { return m_name; }
QString CastReceiverApplication::jellyfinId() const { return m_jellyfinId; }
void XmlAttribute::setName(QString newName) {
void CastReceiverApplication::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
QString CastReceiverApplication::name() const { return m_name; }
void CastReceiverApplication::setName(QString newName) {
m_name = newName;
}
bool XmlAttribute::nameNull() const {
return m_name.isNull();
}
void XmlAttribute::setNameNull() {
m_name.clear();
}
QString XmlAttribute::value() const { return m_value; }
void XmlAttribute::setValue(QString newValue) {
m_value = newValue;
}
bool XmlAttribute::valueNull() const {
return m_value.isNull();
}
void XmlAttribute::setValueNull() {
m_value.clear();
}
} // NS DTO
namespace Support {
using XmlAttribute = Jellyfin::DTO::XmlAttribute;
using CastReceiverApplication = Jellyfin::DTO::CastReceiverApplication;
template <>
XmlAttribute fromJsonValue(const QJsonValue &source, convertType<XmlAttribute>) {
CastReceiverApplication fromJsonValue(const QJsonValue &source, convertType<CastReceiverApplication>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return XmlAttribute::fromJson(source.toObject());
return CastReceiverApplication::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const XmlAttribute &source, convertType<XmlAttribute>) {
QJsonValue toJsonValue(const CastReceiverApplication &source, convertType<CastReceiverApplication>) {
return source.toJson();
}

View file

@ -34,13 +34,23 @@ namespace DTO {
ChannelFeatures::ChannelFeatures() {}
ChannelFeatures::ChannelFeatures (
QString name,
QString jellyfinId,
bool canSearch,
QList<ChannelMediaType> mediaTypes,
QList<ChannelMediaContentType> contentTypes,
QList<ChannelItemSortField> defaultSortFields,
bool supportsSortOrderToggle,
bool supportsLatestMedia,
bool canFilter,
bool supportsContentDownloading
) :
m_name(name),
m_jellyfinId(jellyfinId),
m_canSearch(canSearch),
m_mediaTypes(mediaTypes),
m_contentTypes(contentTypes),
m_defaultSortFields(defaultSortFields),
m_supportsSortOrderToggle(supportsSortOrderToggle),
m_supportsLatestMedia(supportsLatestMedia),
m_canFilter(canFilter),
@ -105,27 +115,11 @@ void ChannelFeatures::setFromJson(QJsonObject source) {
QJsonObject ChannelFeatures::toJson() const {
QJsonObject result;
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["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["CanSearch"] = Jellyfin::Support::toJsonValue<bool>(m_canSearch);
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);
}
result["MediaTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaType>>(m_mediaTypes);
result["ContentTypes"] = Jellyfin::Support::toJsonValue<QList<ChannelMediaContentType>>(m_contentTypes);
if (!(!m_maxPageSize.has_value())) {
result["MaxPageSize"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_maxPageSize);
@ -136,11 +130,7 @@ QJsonObject ChannelFeatures::toJson() const {
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["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);
@ -153,27 +143,13 @@ QString ChannelFeatures::name() const { return m_name; }
void ChannelFeatures::setName(QString newName) {
m_name = newName;
}
bool ChannelFeatures::nameNull() const {
return m_name.isNull();
}
void ChannelFeatures::setNameNull() {
m_name.clear();
}
QString ChannelFeatures::jellyfinId() const { return m_jellyfinId; }
void ChannelFeatures::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
bool ChannelFeatures::jellyfinIdNull() const {
return m_jellyfinId.isNull();
}
void ChannelFeatures::setJellyfinIdNull() {
m_jellyfinId.clear();
}
bool ChannelFeatures::canSearch() const { return m_canSearch; }
void ChannelFeatures::setCanSearch(bool newCanSearch) {
@ -185,27 +161,13 @@ QList<ChannelMediaType> ChannelFeatures::mediaTypes() const { return m_mediaType
void ChannelFeatures::setMediaTypes(QList<ChannelMediaType> newMediaTypes) {
m_mediaTypes = newMediaTypes;
}
bool ChannelFeatures::mediaTypesNull() const {
return m_mediaTypes.size() == 0;
}
void ChannelFeatures::setMediaTypesNull() {
m_mediaTypes.clear();
}
QList<ChannelMediaContentType> ChannelFeatures::contentTypes() const { return m_contentTypes; }
void ChannelFeatures::setContentTypes(QList<ChannelMediaContentType> newContentTypes) {
m_contentTypes = newContentTypes;
}
bool ChannelFeatures::contentTypesNull() const {
return m_contentTypes.size() == 0;
}
void ChannelFeatures::setContentTypesNull() {
m_contentTypes.clear();
}
std::optional<qint32> ChannelFeatures::maxPageSize() const { return m_maxPageSize; }
void ChannelFeatures::setMaxPageSize(std::optional<qint32> newMaxPageSize) {
@ -237,14 +199,7 @@ QList<ChannelItemSortField> ChannelFeatures::defaultSortFields() const { return
void ChannelFeatures::setDefaultSortFields(QList<ChannelItemSortField> newDefaultSortFields) {
m_defaultSortFields = newDefaultSortFields;
}
bool ChannelFeatures::defaultSortFieldsNull() const {
return m_defaultSortFields.size() == 0;
}
void ChannelFeatures::setDefaultSortFieldsNull() {
m_defaultSortFields.clear();
}
bool ChannelFeatures::supportsSortOrderToggle() const { return m_supportsSortOrderToggle; }
void ChannelFeatures::setSupportsSortOrderToggle(bool newSupportsSortOrderToggle) {

View file

@ -33,6 +33,16 @@ namespace Jellyfin {
namespace DTO {
ChannelMappingOptionsDto::ChannelMappingOptionsDto() {}
ChannelMappingOptionsDto::ChannelMappingOptionsDto (
QList<TunerChannelMapping> tunerChannels,
QList<NameIdPair> providerChannels,
QList<NameValuePair> mappings
) :
m_tunerChannels(tunerChannels),
m_providerChannels(providerChannels),
m_mappings(mappings) { }
ChannelMappingOptionsDto::ChannelMappingOptionsDto(const ChannelMappingOptionsDto &other) :
@ -67,21 +77,9 @@ void ChannelMappingOptionsDto::setFromJson(QJsonObject source) {
QJsonObject ChannelMappingOptionsDto::toJson() const {
QJsonObject result;
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);
}
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);
if (!(m_providerName.isNull())) {
result["ProviderName"] = Jellyfin::Support::toJsonValue<QString>(m_providerName);
@ -95,40 +93,19 @@ QList<TunerChannelMapping> ChannelMappingOptionsDto::tunerChannels() const { ret
void ChannelMappingOptionsDto::setTunerChannels(QList<TunerChannelMapping> newTunerChannels) {
m_tunerChannels = newTunerChannels;
}
bool ChannelMappingOptionsDto::tunerChannelsNull() const {
return m_tunerChannels.size() == 0;
}
void ChannelMappingOptionsDto::setTunerChannelsNull() {
m_tunerChannels.clear();
}
QList<NameIdPair> ChannelMappingOptionsDto::providerChannels() const { return m_providerChannels; }
void ChannelMappingOptionsDto::setProviderChannels(QList<NameIdPair> newProviderChannels) {
m_providerChannels = newProviderChannels;
}
bool ChannelMappingOptionsDto::providerChannelsNull() const {
return m_providerChannels.size() == 0;
}
void ChannelMappingOptionsDto::setProviderChannelsNull() {
m_providerChannels.clear();
}
QList<NameValuePair> ChannelMappingOptionsDto::mappings() const { return m_mappings; }
void ChannelMappingOptionsDto::setMappings(QList<NameValuePair> newMappings) {
m_mappings = newMappings;
}
bool ChannelMappingOptionsDto::mappingsNull() const {
return m_mappings.size() == 0;
}
void ChannelMappingOptionsDto::setMappingsNull() {
m_mappings.clear();
}
QString ChannelMappingOptionsDto::providerName() const { return m_providerName; }
void ChannelMappingOptionsDto::setProviderName(QString newProviderName) {

View file

@ -1,249 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/clientcapabilities.h>
namespace Jellyfin {
namespace DTO {
ClientCapabilities::ClientCapabilities() {}
ClientCapabilities::ClientCapabilities (
bool supportsMediaControl,
bool supportsContentUploading,
bool supportsPersistentIdentifier,
bool supportsSync,
QSharedPointer<DeviceProfile> deviceProfile
) :
m_supportsMediaControl(supportsMediaControl),
m_supportsContentUploading(supportsContentUploading),
m_supportsPersistentIdentifier(supportsPersistentIdentifier),
m_supportsSync(supportsSync),
m_deviceProfile(deviceProfile) { }
ClientCapabilities::ClientCapabilities(const ClientCapabilities &other) :
m_playableMediaTypes(other.m_playableMediaTypes),
m_supportedCommands(other.m_supportedCommands),
m_supportsMediaControl(other.m_supportsMediaControl),
m_supportsContentUploading(other.m_supportsContentUploading),
m_messageCallbackUrl(other.m_messageCallbackUrl),
m_supportsPersistentIdentifier(other.m_supportsPersistentIdentifier),
m_supportsSync(other.m_supportsSync),
m_deviceProfile(other.m_deviceProfile),
m_appStoreUrl(other.m_appStoreUrl),
m_iconUrl(other.m_iconUrl){}
void ClientCapabilities::replaceData(ClientCapabilities &other) {
m_playableMediaTypes = other.m_playableMediaTypes;
m_supportedCommands = other.m_supportedCommands;
m_supportsMediaControl = other.m_supportsMediaControl;
m_supportsContentUploading = other.m_supportsContentUploading;
m_messageCallbackUrl = other.m_messageCallbackUrl;
m_supportsPersistentIdentifier = other.m_supportsPersistentIdentifier;
m_supportsSync = other.m_supportsSync;
m_deviceProfile = other.m_deviceProfile;
m_appStoreUrl = other.m_appStoreUrl;
m_iconUrl = other.m_iconUrl;
}
ClientCapabilities ClientCapabilities::fromJson(QJsonObject source) {
ClientCapabilities instance;
instance.setFromJson(source);
return instance;
}
void ClientCapabilities::setFromJson(QJsonObject source) {
m_playableMediaTypes = Jellyfin::Support::fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
m_supportedCommands = Jellyfin::Support::fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
m_supportsMediaControl = Jellyfin::Support::fromJsonValue<bool>(source["SupportsMediaControl"]);
m_supportsContentUploading = Jellyfin::Support::fromJsonValue<bool>(source["SupportsContentUploading"]);
m_messageCallbackUrl = Jellyfin::Support::fromJsonValue<QString>(source["MessageCallbackUrl"]);
m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
m_supportsSync = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSync"]);
m_deviceProfile = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
m_appStoreUrl = Jellyfin::Support::fromJsonValue<QString>(source["AppStoreUrl"]);
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
}
QJsonObject ClientCapabilities::toJson() const {
QJsonObject result;
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);
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);
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;
}
QStringList ClientCapabilities::playableMediaTypes() const { return m_playableMediaTypes; }
void ClientCapabilities::setPlayableMediaTypes(QStringList newPlayableMediaTypes) {
m_playableMediaTypes = newPlayableMediaTypes;
}
bool ClientCapabilities::playableMediaTypesNull() const {
return m_playableMediaTypes.size() == 0;
}
void ClientCapabilities::setPlayableMediaTypesNull() {
m_playableMediaTypes.clear();
}
QList<GeneralCommandType> ClientCapabilities::supportedCommands() const { return m_supportedCommands; }
void ClientCapabilities::setSupportedCommands(QList<GeneralCommandType> newSupportedCommands) {
m_supportedCommands = newSupportedCommands;
}
bool ClientCapabilities::supportedCommandsNull() const {
return m_supportedCommands.size() == 0;
}
void ClientCapabilities::setSupportedCommandsNull() {
m_supportedCommands.clear();
}
bool ClientCapabilities::supportsMediaControl() const { return m_supportsMediaControl; }
void ClientCapabilities::setSupportsMediaControl(bool newSupportsMediaControl) {
m_supportsMediaControl = newSupportsMediaControl;
}
bool ClientCapabilities::supportsContentUploading() const { return m_supportsContentUploading; }
void ClientCapabilities::setSupportsContentUploading(bool newSupportsContentUploading) {
m_supportsContentUploading = newSupportsContentUploading;
}
QString ClientCapabilities::messageCallbackUrl() const { return m_messageCallbackUrl; }
void ClientCapabilities::setMessageCallbackUrl(QString newMessageCallbackUrl) {
m_messageCallbackUrl = newMessageCallbackUrl;
}
bool ClientCapabilities::messageCallbackUrlNull() const {
return m_messageCallbackUrl.isNull();
}
void ClientCapabilities::setMessageCallbackUrlNull() {
m_messageCallbackUrl.clear();
}
bool ClientCapabilities::supportsPersistentIdentifier() const { return m_supportsPersistentIdentifier; }
void ClientCapabilities::setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier) {
m_supportsPersistentIdentifier = newSupportsPersistentIdentifier;
}
bool ClientCapabilities::supportsSync() const { return m_supportsSync; }
void ClientCapabilities::setSupportsSync(bool newSupportsSync) {
m_supportsSync = newSupportsSync;
}
QSharedPointer<DeviceProfile> ClientCapabilities::deviceProfile() const { return m_deviceProfile; }
void ClientCapabilities::setDeviceProfile(QSharedPointer<DeviceProfile> newDeviceProfile) {
m_deviceProfile = newDeviceProfile;
}
QString ClientCapabilities::appStoreUrl() const { return m_appStoreUrl; }
void ClientCapabilities::setAppStoreUrl(QString newAppStoreUrl) {
m_appStoreUrl = newAppStoreUrl;
}
bool ClientCapabilities::appStoreUrlNull() const {
return m_appStoreUrl.isNull();
}
void ClientCapabilities::setAppStoreUrlNull() {
m_appStoreUrl.clear();
}
QString ClientCapabilities::iconUrl() const { return m_iconUrl; }
void ClientCapabilities::setIconUrl(QString newIconUrl) {
m_iconUrl = newIconUrl;
}
bool ClientCapabilities::iconUrlNull() const {
return m_iconUrl.isNull();
}
void ClientCapabilities::setIconUrlNull() {
m_iconUrl.clear();
}
} // NS DTO
namespace Support {
using ClientCapabilities = Jellyfin::DTO::ClientCapabilities;
template <>
ClientCapabilities fromJsonValue(const QJsonValue &source, convertType<ClientCapabilities>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ClientCapabilities::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ClientCapabilities &source, convertType<ClientCapabilities>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,16 +34,16 @@ namespace DTO {
ClientCapabilitiesDto::ClientCapabilitiesDto() {}
ClientCapabilitiesDto::ClientCapabilitiesDto (
QList<MediaType> playableMediaTypes,
QList<GeneralCommandType> supportedCommands,
bool supportsMediaControl,
bool supportsContentUploading,
bool supportsPersistentIdentifier,
bool supportsSync,
QSharedPointer<DeviceProfile> deviceProfile
) :
m_playableMediaTypes(playableMediaTypes),
m_supportedCommands(supportedCommands),
m_supportsMediaControl(supportsMediaControl),
m_supportsContentUploading(supportsContentUploading),
m_supportsPersistentIdentifier(supportsPersistentIdentifier),
m_supportsSync(supportsSync),
m_deviceProfile(deviceProfile) { }
@ -53,10 +53,7 @@ ClientCapabilitiesDto::ClientCapabilitiesDto(const ClientCapabilitiesDto &other)
m_playableMediaTypes(other.m_playableMediaTypes),
m_supportedCommands(other.m_supportedCommands),
m_supportsMediaControl(other.m_supportsMediaControl),
m_supportsContentUploading(other.m_supportsContentUploading),
m_messageCallbackUrl(other.m_messageCallbackUrl),
m_supportsPersistentIdentifier(other.m_supportsPersistentIdentifier),
m_supportsSync(other.m_supportsSync),
m_deviceProfile(other.m_deviceProfile),
m_appStoreUrl(other.m_appStoreUrl),
m_iconUrl(other.m_iconUrl){}
@ -66,10 +63,7 @@ void ClientCapabilitiesDto::replaceData(ClientCapabilitiesDto &other) {
m_playableMediaTypes = other.m_playableMediaTypes;
m_supportedCommands = other.m_supportedCommands;
m_supportsMediaControl = other.m_supportsMediaControl;
m_supportsContentUploading = other.m_supportsContentUploading;
m_messageCallbackUrl = other.m_messageCallbackUrl;
m_supportsPersistentIdentifier = other.m_supportsPersistentIdentifier;
m_supportsSync = other.m_supportsSync;
m_deviceProfile = other.m_deviceProfile;
m_appStoreUrl = other.m_appStoreUrl;
m_iconUrl = other.m_iconUrl;
@ -83,13 +77,10 @@ ClientCapabilitiesDto ClientCapabilitiesDto::fromJson(QJsonObject source) {
void ClientCapabilitiesDto::setFromJson(QJsonObject source) {
m_playableMediaTypes = Jellyfin::Support::fromJsonValue<QStringList>(source["PlayableMediaTypes"]);
m_playableMediaTypes = Jellyfin::Support::fromJsonValue<QList<MediaType>>(source["PlayableMediaTypes"]);
m_supportedCommands = Jellyfin::Support::fromJsonValue<QList<GeneralCommandType>>(source["SupportedCommands"]);
m_supportsMediaControl = Jellyfin::Support::fromJsonValue<bool>(source["SupportsMediaControl"]);
m_supportsContentUploading = Jellyfin::Support::fromJsonValue<bool>(source["SupportsContentUploading"]);
m_messageCallbackUrl = Jellyfin::Support::fromJsonValue<QString>(source["MessageCallbackUrl"]);
m_supportsPersistentIdentifier = Jellyfin::Support::fromJsonValue<bool>(source["SupportsPersistentIdentifier"]);
m_supportsSync = Jellyfin::Support::fromJsonValue<bool>(source["SupportsSync"]);
m_deviceProfile = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceProfile>>(source["DeviceProfile"]);
m_appStoreUrl = Jellyfin::Support::fromJsonValue<QString>(source["AppStoreUrl"]);
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
@ -99,25 +90,10 @@ void ClientCapabilitiesDto::setFromJson(QJsonObject source) {
QJsonObject ClientCapabilitiesDto::toJson() const {
QJsonObject result;
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["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue<QList<MediaType>>(m_playableMediaTypes);
result["SupportedCommands"] = Jellyfin::Support::toJsonValue<QList<GeneralCommandType>>(m_supportedCommands);
result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue<bool>(m_supportsMediaControl);
result["SupportsContentUploading"] = Jellyfin::Support::toJsonValue<bool>(m_supportsContentUploading);
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);
if (!(m_appStoreUrl.isNull())) {
@ -132,69 +108,30 @@ QJsonObject ClientCapabilitiesDto::toJson() const {
return result;
}
QStringList ClientCapabilitiesDto::playableMediaTypes() const { return m_playableMediaTypes; }
QList<MediaType> ClientCapabilitiesDto::playableMediaTypes() const { return m_playableMediaTypes; }
void ClientCapabilitiesDto::setPlayableMediaTypes(QStringList newPlayableMediaTypes) {
void ClientCapabilitiesDto::setPlayableMediaTypes(QList<MediaType> newPlayableMediaTypes) {
m_playableMediaTypes = newPlayableMediaTypes;
}
bool ClientCapabilitiesDto::playableMediaTypesNull() const {
return m_playableMediaTypes.size() == 0;
}
void ClientCapabilitiesDto::setPlayableMediaTypesNull() {
m_playableMediaTypes.clear();
}
QList<GeneralCommandType> ClientCapabilitiesDto::supportedCommands() const { return m_supportedCommands; }
void ClientCapabilitiesDto::setSupportedCommands(QList<GeneralCommandType> newSupportedCommands) {
m_supportedCommands = newSupportedCommands;
}
bool ClientCapabilitiesDto::supportedCommandsNull() const {
return m_supportedCommands.size() == 0;
}
void ClientCapabilitiesDto::setSupportedCommandsNull() {
m_supportedCommands.clear();
}
bool ClientCapabilitiesDto::supportsMediaControl() const { return m_supportsMediaControl; }
void ClientCapabilitiesDto::setSupportsMediaControl(bool newSupportsMediaControl) {
m_supportsMediaControl = newSupportsMediaControl;
}
bool ClientCapabilitiesDto::supportsContentUploading() const { return m_supportsContentUploading; }
void ClientCapabilitiesDto::setSupportsContentUploading(bool newSupportsContentUploading) {
m_supportsContentUploading = newSupportsContentUploading;
}
QString ClientCapabilitiesDto::messageCallbackUrl() const { return m_messageCallbackUrl; }
void ClientCapabilitiesDto::setMessageCallbackUrl(QString newMessageCallbackUrl) {
m_messageCallbackUrl = newMessageCallbackUrl;
}
bool ClientCapabilitiesDto::messageCallbackUrlNull() const {
return m_messageCallbackUrl.isNull();
}
void ClientCapabilitiesDto::setMessageCallbackUrlNull() {
m_messageCallbackUrl.clear();
}
bool ClientCapabilitiesDto::supportsPersistentIdentifier() const { return m_supportsPersistentIdentifier; }
void ClientCapabilitiesDto::setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier) {
m_supportsPersistentIdentifier = newSupportsPersistentIdentifier;
}
bool ClientCapabilitiesDto::supportsSync() const { return m_supportsSync; }
void ClientCapabilitiesDto::setSupportsSync(bool newSupportsSync) {
m_supportsSync = newSupportsSync;
}
QSharedPointer<DeviceProfile> ClientCapabilitiesDto::deviceProfile() const { return m_deviceProfile; }
void ClientCapabilitiesDto::setDeviceProfile(QSharedPointer<DeviceProfile> newDeviceProfile) {

View file

@ -0,0 +1,96 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/clientlogdocumentresponsedto.h>
namespace Jellyfin {
namespace DTO {
ClientLogDocumentResponseDto::ClientLogDocumentResponseDto() {}
ClientLogDocumentResponseDto::ClientLogDocumentResponseDto (
QString fileName
) :
m_fileName(fileName) { }
ClientLogDocumentResponseDto::ClientLogDocumentResponseDto(const ClientLogDocumentResponseDto &other) :
m_fileName(other.m_fileName){}
void ClientLogDocumentResponseDto::replaceData(ClientLogDocumentResponseDto &other) {
m_fileName = other.m_fileName;
}
ClientLogDocumentResponseDto ClientLogDocumentResponseDto::fromJson(QJsonObject source) {
ClientLogDocumentResponseDto instance;
instance.setFromJson(source);
return instance;
}
void ClientLogDocumentResponseDto::setFromJson(QJsonObject source) {
m_fileName = Jellyfin::Support::fromJsonValue<QString>(source["FileName"]);
}
QJsonObject ClientLogDocumentResponseDto::toJson() const {
QJsonObject result;
result["FileName"] = Jellyfin::Support::toJsonValue<QString>(m_fileName);
return result;
}
QString ClientLogDocumentResponseDto::fileName() const { return m_fileName; }
void ClientLogDocumentResponseDto::setFileName(QString newFileName) {
m_fileName = newFileName;
}
} // NS DTO
namespace Support {
using ClientLogDocumentResponseDto = Jellyfin::DTO::ClientLogDocumentResponseDto;
template <>
ClientLogDocumentResponseDto fromJsonValue(const QJsonValue &source, convertType<ClientLogDocumentResponseDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ClientLogDocumentResponseDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ClientLogDocumentResponseDto &source, convertType<ClientLogDocumentResponseDto>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,9 +34,13 @@ namespace DTO {
CodecProfile::CodecProfile() {}
CodecProfile::CodecProfile (
CodecType type
CodecType type,
QList<ProfileCondition> conditions,
QList<ProfileCondition> applyConditions
) :
m_type(type) { }
m_type(type),
m_conditions(conditions),
m_applyConditions(applyConditions) { }
@ -46,7 +50,8 @@ CodecProfile::CodecProfile(const CodecProfile &other) :
m_conditions(other.m_conditions),
m_applyConditions(other.m_applyConditions),
m_codec(other.m_codec),
m_container(other.m_container){}
m_container(other.m_container),
m_subContainer(other.m_subContainer){}
void CodecProfile::replaceData(CodecProfile &other) {
@ -55,6 +60,7 @@ void CodecProfile::replaceData(CodecProfile &other) {
m_applyConditions = other.m_applyConditions;
m_codec = other.m_codec;
m_container = other.m_container;
m_subContainer = other.m_subContainer;
}
CodecProfile CodecProfile::fromJson(QJsonObject source) {
@ -70,6 +76,7 @@ void CodecProfile::setFromJson(QJsonObject source) {
m_applyConditions = Jellyfin::Support::fromJsonValue<QList<ProfileCondition>>(source["ApplyConditions"]);
m_codec = Jellyfin::Support::fromJsonValue<QString>(source["Codec"]);
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
m_subContainer = Jellyfin::Support::fromJsonValue<QString>(source["SubContainer"]);
}
@ -77,16 +84,8 @@ QJsonObject CodecProfile::toJson() const {
QJsonObject result;
result["Type"] = Jellyfin::Support::toJsonValue<CodecType>(m_type);
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);
}
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
result["ApplyConditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_applyConditions);
if (!(m_codec.isNull())) {
result["Codec"] = Jellyfin::Support::toJsonValue<QString>(m_codec);
@ -96,6 +95,11 @@ QJsonObject CodecProfile::toJson() const {
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
if (!(m_subContainer.isNull())) {
result["SubContainer"] = Jellyfin::Support::toJsonValue<QString>(m_subContainer);
}
return result;
}
@ -111,27 +115,13 @@ QList<ProfileCondition> CodecProfile::conditions() const { return m_conditions;
void CodecProfile::setConditions(QList<ProfileCondition> newConditions) {
m_conditions = newConditions;
}
bool CodecProfile::conditionsNull() const {
return m_conditions.size() == 0;
}
void CodecProfile::setConditionsNull() {
m_conditions.clear();
}
QList<ProfileCondition> CodecProfile::applyConditions() const { return m_applyConditions; }
void CodecProfile::setApplyConditions(QList<ProfileCondition> newApplyConditions) {
m_applyConditions = newApplyConditions;
}
bool CodecProfile::applyConditionsNull() const {
return m_applyConditions.size() == 0;
}
void CodecProfile::setApplyConditionsNull() {
m_applyConditions.clear();
}
QString CodecProfile::codec() const { return m_codec; }
void CodecProfile::setCodec(QString newCodec) {
@ -157,6 +147,19 @@ bool CodecProfile::containerNull() const {
void CodecProfile::setContainerNull() {
m_container.clear();
}
QString CodecProfile::subContainer() const { return m_subContainer; }
void CodecProfile::setSubContainer(QString newSubContainer) {
m_subContainer = newSubContainer;
}
bool CodecProfile::subContainerNull() const {
return m_subContainer.isNull();
}
void CodecProfile::setSubContainerNull() {
m_subContainer.clear();
}
} // NS DTO

View file

@ -0,0 +1,128 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/collectiontype.h>
namespace Jellyfin {
namespace DTO {
CollectionTypeClass::CollectionTypeClass() {}
} // NS DTO
namespace Support {
using CollectionType = Jellyfin::DTO::CollectionType;
template <>
CollectionType fromJsonValue(const QJsonValue &source, convertType<CollectionType>) {
if (!source.isString()) return CollectionType::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("unknown")) {
return CollectionType::Unknown;
}
if (str == QStringLiteral("movies")) {
return CollectionType::Movies;
}
if (str == QStringLiteral("tvshows")) {
return CollectionType::Tvshows;
}
if (str == QStringLiteral("music")) {
return CollectionType::Music;
}
if (str == QStringLiteral("musicvideos")) {
return CollectionType::Musicvideos;
}
if (str == QStringLiteral("trailers")) {
return CollectionType::Trailers;
}
if (str == QStringLiteral("homevideos")) {
return CollectionType::Homevideos;
}
if (str == QStringLiteral("boxsets")) {
return CollectionType::Boxsets;
}
if (str == QStringLiteral("books")) {
return CollectionType::Books;
}
if (str == QStringLiteral("photos")) {
return CollectionType::Photos;
}
if (str == QStringLiteral("livetv")) {
return CollectionType::Livetv;
}
if (str == QStringLiteral("playlists")) {
return CollectionType::Playlists;
}
if (str == QStringLiteral("folders")) {
return CollectionType::Folders;
}
return CollectionType::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const CollectionType &source, convertType<CollectionType>) {
switch(source) {
case CollectionType::Unknown:
return QStringLiteral("unknown");
case CollectionType::Movies:
return QStringLiteral("movies");
case CollectionType::Tvshows:
return QStringLiteral("tvshows");
case CollectionType::Music:
return QStringLiteral("music");
case CollectionType::Musicvideos:
return QStringLiteral("musicvideos");
case CollectionType::Trailers:
return QStringLiteral("trailers");
case CollectionType::Homevideos:
return QStringLiteral("homevideos");
case CollectionType::Boxsets:
return QStringLiteral("boxsets");
case CollectionType::Books:
return QStringLiteral("books");
case CollectionType::Photos:
return QStringLiteral("photos");
case CollectionType::Livetv:
return QStringLiteral("livetv");
case CollectionType::Playlists:
return QStringLiteral("playlists");
case CollectionType::Folders:
return QStringLiteral("folders");
case CollectionType::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,103 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/collectiontypeoptions.h>
namespace Jellyfin {
namespace DTO {
CollectionTypeOptionsClass::CollectionTypeOptionsClass() {}
} // NS DTO
namespace Support {
using CollectionTypeOptions = Jellyfin::DTO::CollectionTypeOptions;
template <>
CollectionTypeOptions fromJsonValue(const QJsonValue &source, convertType<CollectionTypeOptions>) {
if (!source.isString()) return CollectionTypeOptions::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("movies")) {
return CollectionTypeOptions::Movies;
}
if (str == QStringLiteral("tvshows")) {
return CollectionTypeOptions::Tvshows;
}
if (str == QStringLiteral("music")) {
return CollectionTypeOptions::Music;
}
if (str == QStringLiteral("musicvideos")) {
return CollectionTypeOptions::Musicvideos;
}
if (str == QStringLiteral("homevideos")) {
return CollectionTypeOptions::Homevideos;
}
if (str == QStringLiteral("boxsets")) {
return CollectionTypeOptions::Boxsets;
}
if (str == QStringLiteral("books")) {
return CollectionTypeOptions::Books;
}
if (str == QStringLiteral("mixed")) {
return CollectionTypeOptions::Mixed;
}
return CollectionTypeOptions::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const CollectionTypeOptions &source, convertType<CollectionTypeOptions>) {
switch(source) {
case CollectionTypeOptions::Movies:
return QStringLiteral("movies");
case CollectionTypeOptions::Tvshows:
return QStringLiteral("tvshows");
case CollectionTypeOptions::Music:
return QStringLiteral("music");
case CollectionTypeOptions::Musicvideos:
return QStringLiteral("musicvideos");
case CollectionTypeOptions::Homevideos:
return QStringLiteral("homevideos");
case CollectionTypeOptions::Boxsets:
return QStringLiteral("boxsets");
case CollectionTypeOptions::Books:
return QStringLiteral("books");
case CollectionTypeOptions::Mixed:
return QStringLiteral("mixed");
case CollectionTypeOptions::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,227 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/configimagetypes.h>
namespace Jellyfin {
namespace DTO {
ConfigImageTypes::ConfigImageTypes() {}
ConfigImageTypes::ConfigImageTypes(const ConfigImageTypes &other) :
m_backdropSizes(other.m_backdropSizes),
m_baseUrl(other.m_baseUrl),
m_logoSizes(other.m_logoSizes),
m_posterSizes(other.m_posterSizes),
m_profileSizes(other.m_profileSizes),
m_secureBaseUrl(other.m_secureBaseUrl),
m_stillSizes(other.m_stillSizes){}
void ConfigImageTypes::replaceData(ConfigImageTypes &other) {
m_backdropSizes = other.m_backdropSizes;
m_baseUrl = other.m_baseUrl;
m_logoSizes = other.m_logoSizes;
m_posterSizes = other.m_posterSizes;
m_profileSizes = other.m_profileSizes;
m_secureBaseUrl = other.m_secureBaseUrl;
m_stillSizes = other.m_stillSizes;
}
ConfigImageTypes ConfigImageTypes::fromJson(QJsonObject source) {
ConfigImageTypes instance;
instance.setFromJson(source);
return instance;
}
void ConfigImageTypes::setFromJson(QJsonObject source) {
m_backdropSizes = Jellyfin::Support::fromJsonValue<QStringList>(source["BackdropSizes"]);
m_baseUrl = Jellyfin::Support::fromJsonValue<QString>(source["BaseUrl"]);
m_logoSizes = Jellyfin::Support::fromJsonValue<QStringList>(source["LogoSizes"]);
m_posterSizes = Jellyfin::Support::fromJsonValue<QStringList>(source["PosterSizes"]);
m_profileSizes = Jellyfin::Support::fromJsonValue<QStringList>(source["ProfileSizes"]);
m_secureBaseUrl = Jellyfin::Support::fromJsonValue<QString>(source["SecureBaseUrl"]);
m_stillSizes = Jellyfin::Support::fromJsonValue<QStringList>(source["StillSizes"]);
}
QJsonObject ConfigImageTypes::toJson() const {
QJsonObject result;
if (!(m_backdropSizes.size() == 0)) {
result["BackdropSizes"] = Jellyfin::Support::toJsonValue<QStringList>(m_backdropSizes);
}
if (!(m_baseUrl.isNull())) {
result["BaseUrl"] = Jellyfin::Support::toJsonValue<QString>(m_baseUrl);
}
if (!(m_logoSizes.size() == 0)) {
result["LogoSizes"] = Jellyfin::Support::toJsonValue<QStringList>(m_logoSizes);
}
if (!(m_posterSizes.size() == 0)) {
result["PosterSizes"] = Jellyfin::Support::toJsonValue<QStringList>(m_posterSizes);
}
if (!(m_profileSizes.size() == 0)) {
result["ProfileSizes"] = Jellyfin::Support::toJsonValue<QStringList>(m_profileSizes);
}
if (!(m_secureBaseUrl.isNull())) {
result["SecureBaseUrl"] = Jellyfin::Support::toJsonValue<QString>(m_secureBaseUrl);
}
if (!(m_stillSizes.size() == 0)) {
result["StillSizes"] = Jellyfin::Support::toJsonValue<QStringList>(m_stillSizes);
}
return result;
}
QStringList ConfigImageTypes::backdropSizes() const { return m_backdropSizes; }
void ConfigImageTypes::setBackdropSizes(QStringList newBackdropSizes) {
m_backdropSizes = newBackdropSizes;
}
bool ConfigImageTypes::backdropSizesNull() const {
return m_backdropSizes.size() == 0;
}
void ConfigImageTypes::setBackdropSizesNull() {
m_backdropSizes.clear();
}
QString ConfigImageTypes::baseUrl() const { return m_baseUrl; }
void ConfigImageTypes::setBaseUrl(QString newBaseUrl) {
m_baseUrl = newBaseUrl;
}
bool ConfigImageTypes::baseUrlNull() const {
return m_baseUrl.isNull();
}
void ConfigImageTypes::setBaseUrlNull() {
m_baseUrl.clear();
}
QStringList ConfigImageTypes::logoSizes() const { return m_logoSizes; }
void ConfigImageTypes::setLogoSizes(QStringList newLogoSizes) {
m_logoSizes = newLogoSizes;
}
bool ConfigImageTypes::logoSizesNull() const {
return m_logoSizes.size() == 0;
}
void ConfigImageTypes::setLogoSizesNull() {
m_logoSizes.clear();
}
QStringList ConfigImageTypes::posterSizes() const { return m_posterSizes; }
void ConfigImageTypes::setPosterSizes(QStringList newPosterSizes) {
m_posterSizes = newPosterSizes;
}
bool ConfigImageTypes::posterSizesNull() const {
return m_posterSizes.size() == 0;
}
void ConfigImageTypes::setPosterSizesNull() {
m_posterSizes.clear();
}
QStringList ConfigImageTypes::profileSizes() const { return m_profileSizes; }
void ConfigImageTypes::setProfileSizes(QStringList newProfileSizes) {
m_profileSizes = newProfileSizes;
}
bool ConfigImageTypes::profileSizesNull() const {
return m_profileSizes.size() == 0;
}
void ConfigImageTypes::setProfileSizesNull() {
m_profileSizes.clear();
}
QString ConfigImageTypes::secureBaseUrl() const { return m_secureBaseUrl; }
void ConfigImageTypes::setSecureBaseUrl(QString newSecureBaseUrl) {
m_secureBaseUrl = newSecureBaseUrl;
}
bool ConfigImageTypes::secureBaseUrlNull() const {
return m_secureBaseUrl.isNull();
}
void ConfigImageTypes::setSecureBaseUrlNull() {
m_secureBaseUrl.clear();
}
QStringList ConfigImageTypes::stillSizes() const { return m_stillSizes; }
void ConfigImageTypes::setStillSizes(QStringList newStillSizes) {
m_stillSizes = newStillSizes;
}
bool ConfigImageTypes::stillSizesNull() const {
return m_stillSizes.size() == 0;
}
void ConfigImageTypes::setStillSizesNull() {
m_stillSizes.clear();
}
} // NS DTO
namespace Support {
using ConfigImageTypes = Jellyfin::DTO::ConfigImageTypes;
template <>
ConfigImageTypes fromJsonValue(const QJsonValue &source, convertType<ConfigImageTypes>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ConfigImageTypes::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ConfigImageTypes &source, convertType<ConfigImageTypes>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,11 +34,11 @@ namespace DTO {
ConfigurationPageInfo::ConfigurationPageInfo() {}
ConfigurationPageInfo::ConfigurationPageInfo (
bool enableInMainMenu,
ConfigurationPageType configurationPageType
QString name,
bool enableInMainMenu
) :
m_enableInMainMenu(enableInMainMenu),
m_configurationPageType(configurationPageType) { }
m_name(name),
m_enableInMainMenu(enableInMainMenu) { }
@ -49,7 +49,6 @@ ConfigurationPageInfo::ConfigurationPageInfo(const ConfigurationPageInfo &other)
m_menuSection(other.m_menuSection),
m_menuIcon(other.m_menuIcon),
m_displayName(other.m_displayName),
m_configurationPageType(other.m_configurationPageType),
m_pluginId(other.m_pluginId){}
@ -59,7 +58,6 @@ void ConfigurationPageInfo::replaceData(ConfigurationPageInfo &other) {
m_menuSection = other.m_menuSection;
m_menuIcon = other.m_menuIcon;
m_displayName = other.m_displayName;
m_configurationPageType = other.m_configurationPageType;
m_pluginId = other.m_pluginId;
}
@ -76,7 +74,6 @@ void ConfigurationPageInfo::setFromJson(QJsonObject source) {
m_menuSection = Jellyfin::Support::fromJsonValue<QString>(source["MenuSection"]);
m_menuIcon = Jellyfin::Support::fromJsonValue<QString>(source["MenuIcon"]);
m_displayName = Jellyfin::Support::fromJsonValue<QString>(source["DisplayName"]);
m_configurationPageType = Jellyfin::Support::fromJsonValue<ConfigurationPageType>(source["ConfigurationPageType"]);
m_pluginId = Jellyfin::Support::fromJsonValue<QString>(source["PluginId"]);
}
@ -84,11 +81,7 @@ void ConfigurationPageInfo::setFromJson(QJsonObject source) {
QJsonObject ConfigurationPageInfo::toJson() const {
QJsonObject result;
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["EnableInMainMenu"] = Jellyfin::Support::toJsonValue<bool>(m_enableInMainMenu);
if (!(m_menuSection.isNull())) {
@ -105,7 +98,6 @@ QJsonObject ConfigurationPageInfo::toJson() const {
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
}
result["ConfigurationPageType"] = Jellyfin::Support::toJsonValue<ConfigurationPageType>(m_configurationPageType);
if (!(m_pluginId.isNull())) {
result["PluginId"] = Jellyfin::Support::toJsonValue<QString>(m_pluginId);
@ -119,14 +111,7 @@ QString ConfigurationPageInfo::name() const { return m_name; }
void ConfigurationPageInfo::setName(QString newName) {
m_name = newName;
}
bool ConfigurationPageInfo::nameNull() const {
return m_name.isNull();
}
void ConfigurationPageInfo::setNameNull() {
m_name.clear();
}
bool ConfigurationPageInfo::enableInMainMenu() const { return m_enableInMainMenu; }
void ConfigurationPageInfo::setEnableInMainMenu(bool newEnableInMainMenu) {
@ -172,12 +157,6 @@ void ConfigurationPageInfo::setDisplayNameNull() {
m_displayName.clear();
}
ConfigurationPageType ConfigurationPageInfo::configurationPageType() const { return m_configurationPageType; }
void ConfigurationPageInfo::setConfigurationPageType(ConfigurationPageType newConfigurationPageType) {
m_configurationPageType = newConfigurationPageType;
}
QString ConfigurationPageInfo::pluginId() const { return m_pluginId; }
void ConfigurationPageInfo::setPluginId(QString newPluginId) {

View file

@ -34,9 +34,11 @@ namespace DTO {
ContainerProfile::ContainerProfile() {}
ContainerProfile::ContainerProfile (
DlnaProfileType type
DlnaProfileType type,
QList<ProfileCondition> conditions
) :
m_type(type) { }
m_type(type),
m_conditions(conditions) { }
@ -44,13 +46,15 @@ ContainerProfile::ContainerProfile(const ContainerProfile &other) :
m_type(other.m_type),
m_conditions(other.m_conditions),
m_container(other.m_container){}
m_container(other.m_container),
m_subContainer(other.m_subContainer){}
void ContainerProfile::replaceData(ContainerProfile &other) {
m_type = other.m_type;
m_conditions = other.m_conditions;
m_container = other.m_container;
m_subContainer = other.m_subContainer;
}
ContainerProfile ContainerProfile::fromJson(QJsonObject source) {
@ -64,6 +68,7 @@ void ContainerProfile::setFromJson(QJsonObject source) {
m_type = Jellyfin::Support::fromJsonValue<DlnaProfileType>(source["Type"]);
m_conditions = Jellyfin::Support::fromJsonValue<QList<ProfileCondition>>(source["Conditions"]);
m_container = Jellyfin::Support::fromJsonValue<QString>(source["Container"]);
m_subContainer = Jellyfin::Support::fromJsonValue<QString>(source["SubContainer"]);
}
@ -71,15 +76,16 @@ QJsonObject ContainerProfile::toJson() const {
QJsonObject result;
result["Type"] = Jellyfin::Support::toJsonValue<DlnaProfileType>(m_type);
if (!(m_conditions.size() == 0)) {
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
}
result["Conditions"] = Jellyfin::Support::toJsonValue<QList<ProfileCondition>>(m_conditions);
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
if (!(m_subContainer.isNull())) {
result["SubContainer"] = Jellyfin::Support::toJsonValue<QString>(m_subContainer);
}
return result;
}
@ -95,14 +101,7 @@ QList<ProfileCondition> ContainerProfile::conditions() const { return m_conditio
void ContainerProfile::setConditions(QList<ProfileCondition> newConditions) {
m_conditions = newConditions;
}
bool ContainerProfile::conditionsNull() const {
return m_conditions.size() == 0;
}
void ContainerProfile::setConditionsNull() {
m_conditions.clear();
}
QString ContainerProfile::container() const { return m_container; }
void ContainerProfile::setContainer(QString newContainer) {
@ -115,6 +114,19 @@ bool ContainerProfile::containerNull() const {
void ContainerProfile::setContainerNull() {
m_container.clear();
}
QString ContainerProfile::subContainer() const { return m_subContainer; }
void ContainerProfile::setSubContainer(QString newSubContainer) {
m_subContainer = newSubContainer;
}
bool ContainerProfile::subContainerNull() const {
return m_subContainer.isNull();
}
void ContainerProfile::setSubContainerNull() {
m_subContainer.clear();
}
} // NS DTO

View file

@ -1,138 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/controlresponse.h>
namespace Jellyfin {
namespace DTO {
ControlResponse::ControlResponse() {}
ControlResponse::ControlResponse (
bool isSuccessful
) :
m_isSuccessful(isSuccessful) { }
ControlResponse::ControlResponse(const ControlResponse &other) :
m_headers(other.m_headers),
m_xml(other.m_xml),
m_isSuccessful(other.m_isSuccessful){}
void ControlResponse::replaceData(ControlResponse &other) {
m_headers = other.m_headers;
m_xml = other.m_xml;
m_isSuccessful = other.m_isSuccessful;
}
ControlResponse ControlResponse::fromJson(QJsonObject source) {
ControlResponse instance;
instance.setFromJson(source);
return instance;
}
void ControlResponse::setFromJson(QJsonObject source) {
m_headers = Jellyfin::Support::fromJsonValue<QJsonObject>(source["Headers"]);
m_xml = Jellyfin::Support::fromJsonValue<QString>(source["Xml"]);
m_isSuccessful = Jellyfin::Support::fromJsonValue<bool>(source["IsSuccessful"]);
}
QJsonObject ControlResponse::toJson() const {
QJsonObject result;
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;
}
QJsonObject ControlResponse::headers() const { return m_headers; }
void ControlResponse::setHeaders(QJsonObject newHeaders) {
m_headers = newHeaders;
}
bool ControlResponse::headersNull() const {
return m_headers.isEmpty();
}
void ControlResponse::setHeadersNull() {
m_headers= QJsonObject();
}
QString ControlResponse::xml() const { return m_xml; }
void ControlResponse::setXml(QString newXml) {
m_xml = newXml;
}
bool ControlResponse::xmlNull() const {
return m_xml.isNull();
}
void ControlResponse::setXmlNull() {
m_xml.clear();
}
bool ControlResponse::isSuccessful() const { return m_isSuccessful; }
void ControlResponse::setIsSuccessful(bool newIsSuccessful) {
m_isSuccessful = newIsSuccessful;
}
} // NS DTO
namespace Support {
using ControlResponse = Jellyfin::DTO::ControlResponse;
template <>
ControlResponse fromJsonValue(const QJsonValue &source, convertType<ControlResponse>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ControlResponse::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ControlResponse &source, convertType<ControlResponse>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -33,13 +33,29 @@ namespace Jellyfin {
namespace DTO {
CreatePlaylistDto::CreatePlaylistDto() {}
CreatePlaylistDto::CreatePlaylistDto (
QString name,
QStringList ids,
MediaType mediaType,
QList<PlaylistUserPermissions> users,
bool isPublic
) :
m_name(name),
m_ids(ids),
m_mediaType(mediaType),
m_users(users),
m_isPublic(isPublic) { }
CreatePlaylistDto::CreatePlaylistDto(const CreatePlaylistDto &other) :
m_name(other.m_name),
m_ids(other.m_ids),
m_userId(other.m_userId),
m_mediaType(other.m_mediaType){}
m_mediaType(other.m_mediaType),
m_users(other.m_users),
m_isPublic(other.m_isPublic){}
void CreatePlaylistDto::replaceData(CreatePlaylistDto &other) {
@ -47,6 +63,8 @@ void CreatePlaylistDto::replaceData(CreatePlaylistDto &other) {
m_ids = other.m_ids;
m_userId = other.m_userId;
m_mediaType = other.m_mediaType;
m_users = other.m_users;
m_isPublic = other.m_isPublic;
}
CreatePlaylistDto CreatePlaylistDto::fromJson(QJsonObject source) {
@ -60,33 +78,25 @@ void CreatePlaylistDto::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_ids = Jellyfin::Support::fromJsonValue<QStringList>(source["Ids"]);
m_userId = Jellyfin::Support::fromJsonValue<QString>(source["UserId"]);
m_mediaType = Jellyfin::Support::fromJsonValue<QString>(source["MediaType"]);
m_mediaType = Jellyfin::Support::fromJsonValue<MediaType>(source["MediaType"]);
m_users = Jellyfin::Support::fromJsonValue<QList<PlaylistUserPermissions>>(source["Users"]);
m_isPublic = Jellyfin::Support::fromJsonValue<bool>(source["IsPublic"]);
}
QJsonObject CreatePlaylistDto::toJson() const {
QJsonObject result;
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);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
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);
}
result["MediaType"] = Jellyfin::Support::toJsonValue<MediaType>(m_mediaType);
result["Users"] = Jellyfin::Support::toJsonValue<QList<PlaylistUserPermissions>>(m_users);
result["IsPublic"] = Jellyfin::Support::toJsonValue<bool>(m_isPublic);
return result;
}
@ -95,27 +105,13 @@ QString CreatePlaylistDto::name() const { return m_name; }
void CreatePlaylistDto::setName(QString newName) {
m_name = newName;
}
bool CreatePlaylistDto::nameNull() const {
return m_name.isNull();
}
void CreatePlaylistDto::setNameNull() {
m_name.clear();
}
QStringList CreatePlaylistDto::ids() const { return m_ids; }
void CreatePlaylistDto::setIds(QStringList newIds) {
m_ids = newIds;
}
bool CreatePlaylistDto::idsNull() const {
return m_ids.size() == 0;
}
void CreatePlaylistDto::setIdsNull() {
m_ids.clear();
}
QString CreatePlaylistDto::userId() const { return m_userId; }
void CreatePlaylistDto::setUserId(QString newUserId) {
@ -129,20 +125,25 @@ void CreatePlaylistDto::setUserIdNull() {
m_userId.clear();
}
QString CreatePlaylistDto::mediaType() const { return m_mediaType; }
MediaType CreatePlaylistDto::mediaType() const { return m_mediaType; }
void CreatePlaylistDto::setMediaType(QString newMediaType) {
void CreatePlaylistDto::setMediaType(MediaType newMediaType) {
m_mediaType = newMediaType;
}
bool CreatePlaylistDto::mediaTypeNull() const {
return m_mediaType.isNull();
QList<PlaylistUserPermissions> CreatePlaylistDto::users() const { return m_users; }
void CreatePlaylistDto::setUsers(QList<PlaylistUserPermissions> newUsers) {
m_users = newUsers;
}
void CreatePlaylistDto::setMediaTypeNull() {
m_mediaType.clear();
bool CreatePlaylistDto::isPublic() const { return m_isPublic; }
void CreatePlaylistDto::setIsPublic(bool newIsPublic) {
m_isPublic = newIsPublic;
}
} // NS DTO
namespace Support {

View file

@ -33,6 +33,12 @@ namespace Jellyfin {
namespace DTO {
CreateUserByName::CreateUserByName() {}
CreateUserByName::CreateUserByName (
QString name
) :
m_name(name) { }
CreateUserByName::CreateUserByName(const CreateUserByName &other) :
@ -61,11 +67,7 @@ void CreateUserByName::setFromJson(QJsonObject source) {
QJsonObject CreateUserByName::toJson() const {
QJsonObject result;
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
if (!(m_password.isNull())) {
result["Password"] = Jellyfin::Support::toJsonValue<QString>(m_password);
@ -79,14 +81,7 @@ QString CreateUserByName::name() const { return m_name; }
void CreateUserByName::setName(QString newName) {
m_name = newName;
}
bool CreateUserByName::nameNull() const {
return m_name.isNull();
}
void CreateUserByName::setNameNull() {
m_name.clear();
}
QString CreateUserByName::password() const { return m_password; }
void CreateUserByName::setPassword(QString newPassword) {

View file

@ -33,6 +33,18 @@ namespace Jellyfin {
namespace DTO {
CultureDto::CultureDto() {}
CultureDto::CultureDto (
QString name,
QString displayName,
QString twoLetterISOLanguageName,
QStringList threeLetterISOLanguageNames
) :
m_name(name),
m_displayName(displayName),
m_twoLetterISOLanguageName(twoLetterISOLanguageName),
m_threeLetterISOLanguageNames(threeLetterISOLanguageNames) { }
CultureDto::CultureDto(const CultureDto &other) :
@ -70,31 +82,15 @@ void CultureDto::setFromJson(QJsonObject source) {
QJsonObject CultureDto::toJson() const {
QJsonObject result;
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);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["DisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_displayName);
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);
}
result["ThreeLetterISOLanguageNames"] = Jellyfin::Support::toJsonValue<QStringList>(m_threeLetterISOLanguageNames);
return result;
}
@ -103,40 +99,19 @@ QString CultureDto::name() const { return m_name; }
void CultureDto::setName(QString newName) {
m_name = newName;
}
bool CultureDto::nameNull() const {
return m_name.isNull();
}
void CultureDto::setNameNull() {
m_name.clear();
}
QString CultureDto::displayName() const { return m_displayName; }
void CultureDto::setDisplayName(QString newDisplayName) {
m_displayName = newDisplayName;
}
bool CultureDto::displayNameNull() const {
return m_displayName.isNull();
}
void CultureDto::setDisplayNameNull() {
m_displayName.clear();
}
QString CultureDto::twoLetterISOLanguageName() const { return m_twoLetterISOLanguageName; }
void CultureDto::setTwoLetterISOLanguageName(QString newTwoLetterISOLanguageName) {
m_twoLetterISOLanguageName = newTwoLetterISOLanguageName;
}
bool CultureDto::twoLetterISOLanguageNameNull() const {
return m_twoLetterISOLanguageName.isNull();
}
void CultureDto::setTwoLetterISOLanguageNameNull() {
m_twoLetterISOLanguageName.clear();
}
QString CultureDto::threeLetterISOLanguageName() const { return m_threeLetterISOLanguageName; }
void CultureDto::setThreeLetterISOLanguageName(QString newThreeLetterISOLanguageName) {
@ -155,14 +130,7 @@ QStringList CultureDto::threeLetterISOLanguageNames() const { return m_threeLett
void CultureDto::setThreeLetterISOLanguageNames(QStringList newThreeLetterISOLanguageNames) {
m_threeLetterISOLanguageNames = newThreeLetterISOLanguageNames;
}
bool CultureDto::threeLetterISOLanguageNamesNull() const {
return m_threeLetterISOLanguageNames.size() == 0;
}
void CultureDto::setThreeLetterISOLanguageNamesNull() {
m_threeLetterISOLanguageNames.clear();
}
} // NS DTO

View file

@ -27,43 +27,43 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceprofiletype.h>
#include <JellyfinQt/dto/deinterlacemethod.h>
namespace Jellyfin {
namespace DTO {
DeviceProfileTypeClass::DeviceProfileTypeClass() {}
DeinterlaceMethodClass::DeinterlaceMethodClass() {}
} // NS DTO
namespace Support {
using DeviceProfileType = Jellyfin::DTO::DeviceProfileType;
using DeinterlaceMethod = Jellyfin::DTO::DeinterlaceMethod;
template <>
DeviceProfileType fromJsonValue(const QJsonValue &source, convertType<DeviceProfileType>) {
if (!source.isString()) return DeviceProfileType::EnumNotSet;
DeinterlaceMethod fromJsonValue(const QJsonValue &source, convertType<DeinterlaceMethod>) {
if (!source.isString()) return DeinterlaceMethod::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("System")) {
return DeviceProfileType::System;
if (str == QStringLiteral("yadif")) {
return DeinterlaceMethod::Yadif;
}
if (str == QStringLiteral("User")) {
return DeviceProfileType::User;
if (str == QStringLiteral("bwdif")) {
return DeinterlaceMethod::Bwdif;
}
return DeviceProfileType::EnumNotSet;
return DeinterlaceMethod::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const DeviceProfileType &source, convertType<DeviceProfileType>) {
QJsonValue toJsonValue(const DeinterlaceMethod &source, convertType<DeinterlaceMethod>) {
switch(source) {
case DeviceProfileType::System:
return QStringLiteral("System");
case DeviceProfileType::User:
return QStringLiteral("User");
case DeinterlaceMethod::Yadif:
return QStringLiteral("yadif");
case DeinterlaceMethod::Bwdif:
return QStringLiteral("bwdif");
case DeviceProfileType::EnumNotSet: // Fallthrough
case DeinterlaceMethod::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}

View file

@ -1,269 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceidentification.h>
namespace Jellyfin {
namespace DTO {
DeviceIdentification::DeviceIdentification() {}
DeviceIdentification::DeviceIdentification(const DeviceIdentification &other) :
m_friendlyName(other.m_friendlyName),
m_modelNumber(other.m_modelNumber),
m_serialNumber(other.m_serialNumber),
m_modelName(other.m_modelName),
m_modelDescription(other.m_modelDescription),
m_modelUrl(other.m_modelUrl),
m_manufacturer(other.m_manufacturer),
m_manufacturerUrl(other.m_manufacturerUrl),
m_headers(other.m_headers){}
void DeviceIdentification::replaceData(DeviceIdentification &other) {
m_friendlyName = other.m_friendlyName;
m_modelNumber = other.m_modelNumber;
m_serialNumber = other.m_serialNumber;
m_modelName = other.m_modelName;
m_modelDescription = other.m_modelDescription;
m_modelUrl = other.m_modelUrl;
m_manufacturer = other.m_manufacturer;
m_manufacturerUrl = other.m_manufacturerUrl;
m_headers = other.m_headers;
}
DeviceIdentification DeviceIdentification::fromJson(QJsonObject source) {
DeviceIdentification instance;
instance.setFromJson(source);
return instance;
}
void DeviceIdentification::setFromJson(QJsonObject source) {
m_friendlyName = Jellyfin::Support::fromJsonValue<QString>(source["FriendlyName"]);
m_modelNumber = Jellyfin::Support::fromJsonValue<QString>(source["ModelNumber"]);
m_serialNumber = Jellyfin::Support::fromJsonValue<QString>(source["SerialNumber"]);
m_modelName = Jellyfin::Support::fromJsonValue<QString>(source["ModelName"]);
m_modelDescription = Jellyfin::Support::fromJsonValue<QString>(source["ModelDescription"]);
m_modelUrl = Jellyfin::Support::fromJsonValue<QString>(source["ModelUrl"]);
m_manufacturer = Jellyfin::Support::fromJsonValue<QString>(source["Manufacturer"]);
m_manufacturerUrl = Jellyfin::Support::fromJsonValue<QString>(source["ManufacturerUrl"]);
m_headers = Jellyfin::Support::fromJsonValue<QList<HttpHeaderInfo>>(source["Headers"]);
}
QJsonObject DeviceIdentification::toJson() const {
QJsonObject result;
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;
}
QString DeviceIdentification::friendlyName() const { return m_friendlyName; }
void DeviceIdentification::setFriendlyName(QString newFriendlyName) {
m_friendlyName = newFriendlyName;
}
bool DeviceIdentification::friendlyNameNull() const {
return m_friendlyName.isNull();
}
void DeviceIdentification::setFriendlyNameNull() {
m_friendlyName.clear();
}
QString DeviceIdentification::modelNumber() const { return m_modelNumber; }
void DeviceIdentification::setModelNumber(QString newModelNumber) {
m_modelNumber = newModelNumber;
}
bool DeviceIdentification::modelNumberNull() const {
return m_modelNumber.isNull();
}
void DeviceIdentification::setModelNumberNull() {
m_modelNumber.clear();
}
QString DeviceIdentification::serialNumber() const { return m_serialNumber; }
void DeviceIdentification::setSerialNumber(QString newSerialNumber) {
m_serialNumber = newSerialNumber;
}
bool DeviceIdentification::serialNumberNull() const {
return m_serialNumber.isNull();
}
void DeviceIdentification::setSerialNumberNull() {
m_serialNumber.clear();
}
QString DeviceIdentification::modelName() const { return m_modelName; }
void DeviceIdentification::setModelName(QString newModelName) {
m_modelName = newModelName;
}
bool DeviceIdentification::modelNameNull() const {
return m_modelName.isNull();
}
void DeviceIdentification::setModelNameNull() {
m_modelName.clear();
}
QString DeviceIdentification::modelDescription() const { return m_modelDescription; }
void DeviceIdentification::setModelDescription(QString newModelDescription) {
m_modelDescription = newModelDescription;
}
bool DeviceIdentification::modelDescriptionNull() const {
return m_modelDescription.isNull();
}
void DeviceIdentification::setModelDescriptionNull() {
m_modelDescription.clear();
}
QString DeviceIdentification::modelUrl() const { return m_modelUrl; }
void DeviceIdentification::setModelUrl(QString newModelUrl) {
m_modelUrl = newModelUrl;
}
bool DeviceIdentification::modelUrlNull() const {
return m_modelUrl.isNull();
}
void DeviceIdentification::setModelUrlNull() {
m_modelUrl.clear();
}
QString DeviceIdentification::manufacturer() const { return m_manufacturer; }
void DeviceIdentification::setManufacturer(QString newManufacturer) {
m_manufacturer = newManufacturer;
}
bool DeviceIdentification::manufacturerNull() const {
return m_manufacturer.isNull();
}
void DeviceIdentification::setManufacturerNull() {
m_manufacturer.clear();
}
QString DeviceIdentification::manufacturerUrl() const { return m_manufacturerUrl; }
void DeviceIdentification::setManufacturerUrl(QString newManufacturerUrl) {
m_manufacturerUrl = newManufacturerUrl;
}
bool DeviceIdentification::manufacturerUrlNull() const {
return m_manufacturerUrl.isNull();
}
void DeviceIdentification::setManufacturerUrlNull() {
m_manufacturerUrl.clear();
}
QList<HttpHeaderInfo> DeviceIdentification::headers() const { return m_headers; }
void DeviceIdentification::setHeaders(QList<HttpHeaderInfo> newHeaders) {
m_headers = newHeaders;
}
bool DeviceIdentification::headersNull() const {
return m_headers.size() == 0;
}
void DeviceIdentification::setHeadersNull() {
m_headers.clear();
}
} // NS DTO
namespace Support {
using DeviceIdentification = Jellyfin::DTO::DeviceIdentification;
template <>
DeviceIdentification fromJsonValue(const QJsonValue &source, convertType<DeviceIdentification>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceIdentification::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceIdentification &source, convertType<DeviceIdentification>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -27,26 +27,24 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceinfo.h>
#include <JellyfinQt/dto/deviceinfodto.h>
namespace Jellyfin {
namespace DTO {
DeviceInfo::DeviceInfo() {}
DeviceInfo::DeviceInfo (
QString lastUserId,
QDateTime dateLastActivity,
QSharedPointer<ClientCapabilities> capabilities
DeviceInfoDto::DeviceInfoDto() {}
DeviceInfoDto::DeviceInfoDto (
QSharedPointer<ClientCapabilitiesDto> capabilities
) :
m_lastUserId(lastUserId),
m_dateLastActivity(dateLastActivity),
m_capabilities(capabilities) { }
DeviceInfo::DeviceInfo(const DeviceInfo &other) :
DeviceInfoDto::DeviceInfoDto(const DeviceInfoDto &other) :
m_name(other.m_name),
m_customName(other.m_customName),
m_accessToken(other.m_accessToken),
m_jellyfinId(other.m_jellyfinId),
m_lastUserName(other.m_lastUserName),
m_appName(other.m_appName),
@ -57,8 +55,10 @@ DeviceInfo::DeviceInfo(const DeviceInfo &other) :
m_iconUrl(other.m_iconUrl){}
void DeviceInfo::replaceData(DeviceInfo &other) {
void DeviceInfoDto::replaceData(DeviceInfoDto &other) {
m_name = other.m_name;
m_customName = other.m_customName;
m_accessToken = other.m_accessToken;
m_jellyfinId = other.m_jellyfinId;
m_lastUserName = other.m_lastUserName;
m_appName = other.m_appName;
@ -69,27 +69,29 @@ void DeviceInfo::replaceData(DeviceInfo &other) {
m_iconUrl = other.m_iconUrl;
}
DeviceInfo DeviceInfo::fromJson(QJsonObject source) {
DeviceInfo instance;
DeviceInfoDto DeviceInfoDto::fromJson(QJsonObject source) {
DeviceInfoDto instance;
instance.setFromJson(source);
return instance;
}
void DeviceInfo::setFromJson(QJsonObject source) {
void DeviceInfoDto::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_customName = Jellyfin::Support::fromJsonValue<QString>(source["CustomName"]);
m_accessToken = Jellyfin::Support::fromJsonValue<QString>(source["AccessToken"]);
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_lastUserName = Jellyfin::Support::fromJsonValue<QString>(source["LastUserName"]);
m_appName = Jellyfin::Support::fromJsonValue<QString>(source["AppName"]);
m_appVersion = Jellyfin::Support::fromJsonValue<QString>(source["AppVersion"]);
m_lastUserId = Jellyfin::Support::fromJsonValue<QString>(source["LastUserId"]);
m_dateLastActivity = Jellyfin::Support::fromJsonValue<QDateTime>(source["DateLastActivity"]);
m_capabilities = Jellyfin::Support::fromJsonValue<QSharedPointer<ClientCapabilities>>(source["Capabilities"]);
m_capabilities = Jellyfin::Support::fromJsonValue<QSharedPointer<ClientCapabilitiesDto>>(source["Capabilities"]);
m_iconUrl = Jellyfin::Support::fromJsonValue<QString>(source["IconUrl"]);
}
QJsonObject DeviceInfo::toJson() const {
QJsonObject DeviceInfoDto::toJson() const {
QJsonObject result;
@ -98,6 +100,16 @@ QJsonObject DeviceInfo::toJson() const {
}
if (!(m_customName.isNull())) {
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
}
if (!(m_accessToken.isNull())) {
result["AccessToken"] = Jellyfin::Support::toJsonValue<QString>(m_accessToken);
}
if (!(m_jellyfinId.isNull())) {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
@ -117,9 +129,17 @@ QJsonObject DeviceInfo::toJson() const {
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);
if (!(m_lastUserId.isNull())) {
result["LastUserId"] = Jellyfin::Support::toJsonValue<QString>(m_lastUserId);
}
if (!(m_dateLastActivity.isNull())) {
result["DateLastActivity"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateLastActivity);
}
result["Capabilities"] = Jellyfin::Support::toJsonValue<QSharedPointer<ClientCapabilitiesDto>>(m_capabilities);
if (!(m_iconUrl.isNull())) {
result["IconUrl"] = Jellyfin::Support::toJsonValue<QString>(m_iconUrl);
@ -128,99 +148,139 @@ QJsonObject DeviceInfo::toJson() const {
return result;
}
QString DeviceInfo::name() const { return m_name; }
QString DeviceInfoDto::name() const { return m_name; }
void DeviceInfo::setName(QString newName) {
void DeviceInfoDto::setName(QString newName) {
m_name = newName;
}
bool DeviceInfo::nameNull() const {
bool DeviceInfoDto::nameNull() const {
return m_name.isNull();
}
void DeviceInfo::setNameNull() {
void DeviceInfoDto::setNameNull() {
m_name.clear();
}
QString DeviceInfo::jellyfinId() const { return m_jellyfinId; }
QString DeviceInfoDto::customName() const { return m_customName; }
void DeviceInfo::setJellyfinId(QString newJellyfinId) {
void DeviceInfoDto::setCustomName(QString newCustomName) {
m_customName = newCustomName;
}
bool DeviceInfoDto::customNameNull() const {
return m_customName.isNull();
}
void DeviceInfoDto::setCustomNameNull() {
m_customName.clear();
}
QString DeviceInfoDto::accessToken() const { return m_accessToken; }
void DeviceInfoDto::setAccessToken(QString newAccessToken) {
m_accessToken = newAccessToken;
}
bool DeviceInfoDto::accessTokenNull() const {
return m_accessToken.isNull();
}
void DeviceInfoDto::setAccessTokenNull() {
m_accessToken.clear();
}
QString DeviceInfoDto::jellyfinId() const { return m_jellyfinId; }
void DeviceInfoDto::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
bool DeviceInfo::jellyfinIdNull() const {
bool DeviceInfoDto::jellyfinIdNull() const {
return m_jellyfinId.isNull();
}
void DeviceInfo::setJellyfinIdNull() {
void DeviceInfoDto::setJellyfinIdNull() {
m_jellyfinId.clear();
}
QString DeviceInfo::lastUserName() const { return m_lastUserName; }
QString DeviceInfoDto::lastUserName() const { return m_lastUserName; }
void DeviceInfo::setLastUserName(QString newLastUserName) {
void DeviceInfoDto::setLastUserName(QString newLastUserName) {
m_lastUserName = newLastUserName;
}
bool DeviceInfo::lastUserNameNull() const {
bool DeviceInfoDto::lastUserNameNull() const {
return m_lastUserName.isNull();
}
void DeviceInfo::setLastUserNameNull() {
void DeviceInfoDto::setLastUserNameNull() {
m_lastUserName.clear();
}
QString DeviceInfo::appName() const { return m_appName; }
QString DeviceInfoDto::appName() const { return m_appName; }
void DeviceInfo::setAppName(QString newAppName) {
void DeviceInfoDto::setAppName(QString newAppName) {
m_appName = newAppName;
}
bool DeviceInfo::appNameNull() const {
bool DeviceInfoDto::appNameNull() const {
return m_appName.isNull();
}
void DeviceInfo::setAppNameNull() {
void DeviceInfoDto::setAppNameNull() {
m_appName.clear();
}
QString DeviceInfo::appVersion() const { return m_appVersion; }
QString DeviceInfoDto::appVersion() const { return m_appVersion; }
void DeviceInfo::setAppVersion(QString newAppVersion) {
void DeviceInfoDto::setAppVersion(QString newAppVersion) {
m_appVersion = newAppVersion;
}
bool DeviceInfo::appVersionNull() const {
bool DeviceInfoDto::appVersionNull() const {
return m_appVersion.isNull();
}
void DeviceInfo::setAppVersionNull() {
void DeviceInfoDto::setAppVersionNull() {
m_appVersion.clear();
}
QString DeviceInfo::lastUserId() const { return m_lastUserId; }
QString DeviceInfoDto::lastUserId() const { return m_lastUserId; }
void DeviceInfo::setLastUserId(QString newLastUserId) {
void DeviceInfoDto::setLastUserId(QString newLastUserId) {
m_lastUserId = newLastUserId;
}
QDateTime DeviceInfo::dateLastActivity() const { return m_dateLastActivity; }
void DeviceInfo::setDateLastActivity(QDateTime newDateLastActivity) {
m_dateLastActivity = newDateLastActivity;
bool DeviceInfoDto::lastUserIdNull() const {
return m_lastUserId.isNull();
}
QSharedPointer<ClientCapabilities> DeviceInfo::capabilities() const { return m_capabilities; }
void DeviceInfoDto::setLastUserIdNull() {
m_lastUserId.clear();
void DeviceInfo::setCapabilities(QSharedPointer<ClientCapabilities> newCapabilities) {
}
QDateTime DeviceInfoDto::dateLastActivity() const { return m_dateLastActivity; }
void DeviceInfoDto::setDateLastActivity(QDateTime newDateLastActivity) {
m_dateLastActivity = newDateLastActivity;
}
bool DeviceInfoDto::dateLastActivityNull() const {
return m_dateLastActivity.isNull();
}
void DeviceInfoDto::setDateLastActivityNull() {
m_dateLastActivity= QDateTime();
}
QSharedPointer<ClientCapabilitiesDto> DeviceInfoDto::capabilities() const { return m_capabilities; }
void DeviceInfoDto::setCapabilities(QSharedPointer<ClientCapabilitiesDto> newCapabilities) {
m_capabilities = newCapabilities;
}
QString DeviceInfo::iconUrl() const { return m_iconUrl; }
QString DeviceInfoDto::iconUrl() const { return m_iconUrl; }
void DeviceInfo::setIconUrl(QString newIconUrl) {
void DeviceInfoDto::setIconUrl(QString newIconUrl) {
m_iconUrl = newIconUrl;
}
bool DeviceInfo::iconUrlNull() const {
bool DeviceInfoDto::iconUrlNull() const {
return m_iconUrl.isNull();
}
void DeviceInfo::setIconUrlNull() {
void DeviceInfoDto::setIconUrlNull() {
m_iconUrl.clear();
}
@ -229,16 +289,16 @@ void DeviceInfo::setIconUrlNull() {
namespace Support {
using DeviceInfo = Jellyfin::DTO::DeviceInfo;
using DeviceInfoDto = Jellyfin::DTO::DeviceInfoDto;
template <>
DeviceInfo fromJsonValue(const QJsonValue &source, convertType<DeviceInfo>) {
DeviceInfoDto fromJsonValue(const QJsonValue &source, convertType<DeviceInfoDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceInfo::fromJson(source.toObject());
return DeviceInfoDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceInfo &source, convertType<DeviceInfo>) {
QJsonValue toJsonValue(const DeviceInfoDto &source, convertType<DeviceInfoDto>) {
return source.toJson();
}

View file

@ -27,83 +27,74 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceinfoqueryresult.h>
#include <JellyfinQt/dto/deviceinfodtoqueryresult.h>
namespace Jellyfin {
namespace DTO {
DeviceInfoQueryResult::DeviceInfoQueryResult() {}
DeviceInfoQueryResult::DeviceInfoQueryResult (
DeviceInfoDtoQueryResult::DeviceInfoDtoQueryResult() {}
DeviceInfoDtoQueryResult::DeviceInfoDtoQueryResult (
QList<DeviceInfoDto> items,
qint32 totalRecordCount,
qint32 startIndex
) :
m_items(items),
m_totalRecordCount(totalRecordCount),
m_startIndex(startIndex) { }
DeviceInfoQueryResult::DeviceInfoQueryResult(const DeviceInfoQueryResult &other) :
DeviceInfoDtoQueryResult::DeviceInfoDtoQueryResult(const DeviceInfoDtoQueryResult &other) :
m_items(other.m_items),
m_totalRecordCount(other.m_totalRecordCount),
m_startIndex(other.m_startIndex){}
void DeviceInfoQueryResult::replaceData(DeviceInfoQueryResult &other) {
void DeviceInfoDtoQueryResult::replaceData(DeviceInfoDtoQueryResult &other) {
m_items = other.m_items;
m_totalRecordCount = other.m_totalRecordCount;
m_startIndex = other.m_startIndex;
}
DeviceInfoQueryResult DeviceInfoQueryResult::fromJson(QJsonObject source) {
DeviceInfoQueryResult instance;
DeviceInfoDtoQueryResult DeviceInfoDtoQueryResult::fromJson(QJsonObject source) {
DeviceInfoDtoQueryResult instance;
instance.setFromJson(source);
return instance;
}
void DeviceInfoQueryResult::setFromJson(QJsonObject source) {
m_items = Jellyfin::Support::fromJsonValue<QList<DeviceInfo>>(source["Items"]);
void DeviceInfoDtoQueryResult::setFromJson(QJsonObject source) {
m_items = Jellyfin::Support::fromJsonValue<QList<DeviceInfoDto>>(source["Items"]);
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
}
QJsonObject DeviceInfoQueryResult::toJson() const {
QJsonObject DeviceInfoDtoQueryResult::toJson() const {
QJsonObject result;
if (!(m_items.size() == 0)) {
result["Items"] = Jellyfin::Support::toJsonValue<QList<DeviceInfo>>(m_items);
}
result["Items"] = Jellyfin::Support::toJsonValue<QList<DeviceInfoDto>>(m_items);
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}
QList<DeviceInfo> DeviceInfoQueryResult::items() const { return m_items; }
QList<DeviceInfoDto> DeviceInfoDtoQueryResult::items() const { return m_items; }
void DeviceInfoQueryResult::setItems(QList<DeviceInfo> newItems) {
void DeviceInfoDtoQueryResult::setItems(QList<DeviceInfoDto> newItems) {
m_items = newItems;
}
bool DeviceInfoQueryResult::itemsNull() const {
return m_items.size() == 0;
}
void DeviceInfoQueryResult::setItemsNull() {
m_items.clear();
qint32 DeviceInfoDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; }
}
qint32 DeviceInfoQueryResult::totalRecordCount() const { return m_totalRecordCount; }
void DeviceInfoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {
void DeviceInfoDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {
m_totalRecordCount = newTotalRecordCount;
}
qint32 DeviceInfoQueryResult::startIndex() const { return m_startIndex; }
qint32 DeviceInfoDtoQueryResult::startIndex() const { return m_startIndex; }
void DeviceInfoQueryResult::setStartIndex(qint32 newStartIndex) {
void DeviceInfoDtoQueryResult::setStartIndex(qint32 newStartIndex) {
m_startIndex = newStartIndex;
}
@ -112,16 +103,16 @@ void DeviceInfoQueryResult::setStartIndex(qint32 newStartIndex) {
namespace Support {
using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult;
using DeviceInfoDtoQueryResult = Jellyfin::DTO::DeviceInfoDtoQueryResult;
template <>
DeviceInfoQueryResult fromJsonValue(const QJsonValue &source, convertType<DeviceInfoQueryResult>) {
DeviceInfoDtoQueryResult fromJsonValue(const QJsonValue &source, convertType<DeviceInfoDtoQueryResult>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceInfoQueryResult::fromJson(source.toObject());
return DeviceInfoDtoQueryResult::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceInfoQueryResult &source, convertType<DeviceInfoQueryResult>) {
QJsonValue toJsonValue(const DeviceInfoDtoQueryResult &source, convertType<DeviceInfoDtoQueryResult>) {
return source.toJson();
}

View file

@ -0,0 +1,138 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceoptionsdto.h>
namespace Jellyfin {
namespace DTO {
DeviceOptionsDto::DeviceOptionsDto() {}
DeviceOptionsDto::DeviceOptionsDto (
qint32 jellyfinId
) :
m_jellyfinId(jellyfinId) { }
DeviceOptionsDto::DeviceOptionsDto(const DeviceOptionsDto &other) :
m_jellyfinId(other.m_jellyfinId),
m_deviceId(other.m_deviceId),
m_customName(other.m_customName){}
void DeviceOptionsDto::replaceData(DeviceOptionsDto &other) {
m_jellyfinId = other.m_jellyfinId;
m_deviceId = other.m_deviceId;
m_customName = other.m_customName;
}
DeviceOptionsDto DeviceOptionsDto::fromJson(QJsonObject source) {
DeviceOptionsDto instance;
instance.setFromJson(source);
return instance;
}
void DeviceOptionsDto::setFromJson(QJsonObject source) {
m_jellyfinId = Jellyfin::Support::fromJsonValue<qint32>(source["Id"]);
m_deviceId = Jellyfin::Support::fromJsonValue<QString>(source["DeviceId"]);
m_customName = Jellyfin::Support::fromJsonValue<QString>(source["CustomName"]);
}
QJsonObject DeviceOptionsDto::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<qint32>(m_jellyfinId);
if (!(m_deviceId.isNull())) {
result["DeviceId"] = Jellyfin::Support::toJsonValue<QString>(m_deviceId);
}
if (!(m_customName.isNull())) {
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
}
return result;
}
qint32 DeviceOptionsDto::jellyfinId() const { return m_jellyfinId; }
void DeviceOptionsDto::setJellyfinId(qint32 newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
QString DeviceOptionsDto::deviceId() const { return m_deviceId; }
void DeviceOptionsDto::setDeviceId(QString newDeviceId) {
m_deviceId = newDeviceId;
}
bool DeviceOptionsDto::deviceIdNull() const {
return m_deviceId.isNull();
}
void DeviceOptionsDto::setDeviceIdNull() {
m_deviceId.clear();
}
QString DeviceOptionsDto::customName() const { return m_customName; }
void DeviceOptionsDto::setCustomName(QString newCustomName) {
m_customName = newCustomName;
}
bool DeviceOptionsDto::customNameNull() const {
return m_customName.isNull();
}
void DeviceOptionsDto::setCustomNameNull() {
m_customName.clear();
}
} // NS DTO
namespace Support {
using DeviceOptionsDto = Jellyfin::DTO::DeviceOptionsDto;
template <>
DeviceOptionsDto fromJsonValue(const QJsonValue &source, convertType<DeviceOptionsDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceOptionsDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceOptionsDto &source, convertType<DeviceOptionsDto>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,29 +34,17 @@ namespace DTO {
DeviceProfile::DeviceProfile() {}
DeviceProfile::DeviceProfile (
QSharedPointer<DeviceIdentification> identification,
bool enableAlbumArtInDidl,
bool enableSingleAlbumArtLimit,
bool enableSingleSubtitleLimit,
qint32 maxAlbumArtWidth,
qint32 maxAlbumArtHeight,
qint32 timelineOffsetSeconds,
bool requiresPlainVideoItems,
bool requiresPlainFolders,
bool enableMSMediaReceiverRegistrar,
bool ignoreTranscodeByteRangeRequests
QList<DirectPlayProfile> directPlayProfiles,
QList<TranscodingProfile> transcodingProfiles,
QList<ContainerProfile> containerProfiles,
QList<CodecProfile> codecProfiles,
QList<SubtitleProfile> subtitleProfiles
) :
m_identification(identification),
m_enableAlbumArtInDidl(enableAlbumArtInDidl),
m_enableSingleAlbumArtLimit(enableSingleAlbumArtLimit),
m_enableSingleSubtitleLimit(enableSingleSubtitleLimit),
m_maxAlbumArtWidth(maxAlbumArtWidth),
m_maxAlbumArtHeight(maxAlbumArtHeight),
m_timelineOffsetSeconds(timelineOffsetSeconds),
m_requiresPlainVideoItems(requiresPlainVideoItems),
m_requiresPlainFolders(requiresPlainFolders),
m_enableMSMediaReceiverRegistrar(enableMSMediaReceiverRegistrar),
m_ignoreTranscodeByteRangeRequests(ignoreTranscodeByteRangeRequests) { }
m_directPlayProfiles(directPlayProfiles),
m_transcodingProfiles(transcodingProfiles),
m_containerProfiles(containerProfiles),
m_codecProfiles(codecProfiles),
m_subtitleProfiles(subtitleProfiles) { }
@ -64,84 +52,28 @@ DeviceProfile::DeviceProfile(const DeviceProfile &other) :
m_name(other.m_name),
m_jellyfinId(other.m_jellyfinId),
m_identification(other.m_identification),
m_friendlyName(other.m_friendlyName),
m_manufacturer(other.m_manufacturer),
m_manufacturerUrl(other.m_manufacturerUrl),
m_modelName(other.m_modelName),
m_modelDescription(other.m_modelDescription),
m_modelNumber(other.m_modelNumber),
m_modelUrl(other.m_modelUrl),
m_serialNumber(other.m_serialNumber),
m_enableAlbumArtInDidl(other.m_enableAlbumArtInDidl),
m_enableSingleAlbumArtLimit(other.m_enableSingleAlbumArtLimit),
m_enableSingleSubtitleLimit(other.m_enableSingleSubtitleLimit),
m_supportedMediaTypes(other.m_supportedMediaTypes),
m_userId(other.m_userId),
m_albumArtPn(other.m_albumArtPn),
m_maxAlbumArtWidth(other.m_maxAlbumArtWidth),
m_maxAlbumArtHeight(other.m_maxAlbumArtHeight),
m_maxIconWidth(other.m_maxIconWidth),
m_maxIconHeight(other.m_maxIconHeight),
m_maxStreamingBitrate(other.m_maxStreamingBitrate),
m_maxStaticBitrate(other.m_maxStaticBitrate),
m_musicStreamingTranscodingBitrate(other.m_musicStreamingTranscodingBitrate),
m_maxStaticMusicBitrate(other.m_maxStaticMusicBitrate),
m_sonyAggregationFlags(other.m_sonyAggregationFlags),
m_protocolInfo(other.m_protocolInfo),
m_timelineOffsetSeconds(other.m_timelineOffsetSeconds),
m_requiresPlainVideoItems(other.m_requiresPlainVideoItems),
m_requiresPlainFolders(other.m_requiresPlainFolders),
m_enableMSMediaReceiverRegistrar(other.m_enableMSMediaReceiverRegistrar),
m_ignoreTranscodeByteRangeRequests(other.m_ignoreTranscodeByteRangeRequests),
m_xmlRootAttributes(other.m_xmlRootAttributes),
m_directPlayProfiles(other.m_directPlayProfiles),
m_transcodingProfiles(other.m_transcodingProfiles),
m_containerProfiles(other.m_containerProfiles),
m_codecProfiles(other.m_codecProfiles),
m_responseProfiles(other.m_responseProfiles),
m_subtitleProfiles(other.m_subtitleProfiles){}
void DeviceProfile::replaceData(DeviceProfile &other) {
m_name = other.m_name;
m_jellyfinId = other.m_jellyfinId;
m_identification = other.m_identification;
m_friendlyName = other.m_friendlyName;
m_manufacturer = other.m_manufacturer;
m_manufacturerUrl = other.m_manufacturerUrl;
m_modelName = other.m_modelName;
m_modelDescription = other.m_modelDescription;
m_modelNumber = other.m_modelNumber;
m_modelUrl = other.m_modelUrl;
m_serialNumber = other.m_serialNumber;
m_enableAlbumArtInDidl = other.m_enableAlbumArtInDidl;
m_enableSingleAlbumArtLimit = other.m_enableSingleAlbumArtLimit;
m_enableSingleSubtitleLimit = other.m_enableSingleSubtitleLimit;
m_supportedMediaTypes = other.m_supportedMediaTypes;
m_userId = other.m_userId;
m_albumArtPn = other.m_albumArtPn;
m_maxAlbumArtWidth = other.m_maxAlbumArtWidth;
m_maxAlbumArtHeight = other.m_maxAlbumArtHeight;
m_maxIconWidth = other.m_maxIconWidth;
m_maxIconHeight = other.m_maxIconHeight;
m_maxStreamingBitrate = other.m_maxStreamingBitrate;
m_maxStaticBitrate = other.m_maxStaticBitrate;
m_musicStreamingTranscodingBitrate = other.m_musicStreamingTranscodingBitrate;
m_maxStaticMusicBitrate = other.m_maxStaticMusicBitrate;
m_sonyAggregationFlags = other.m_sonyAggregationFlags;
m_protocolInfo = other.m_protocolInfo;
m_timelineOffsetSeconds = other.m_timelineOffsetSeconds;
m_requiresPlainVideoItems = other.m_requiresPlainVideoItems;
m_requiresPlainFolders = other.m_requiresPlainFolders;
m_enableMSMediaReceiverRegistrar = other.m_enableMSMediaReceiverRegistrar;
m_ignoreTranscodeByteRangeRequests = other.m_ignoreTranscodeByteRangeRequests;
m_xmlRootAttributes = other.m_xmlRootAttributes;
m_directPlayProfiles = other.m_directPlayProfiles;
m_transcodingProfiles = other.m_transcodingProfiles;
m_containerProfiles = other.m_containerProfiles;
m_codecProfiles = other.m_codecProfiles;
m_responseProfiles = other.m_responseProfiles;
m_subtitleProfiles = other.m_subtitleProfiles;
}
@ -155,42 +87,14 @@ DeviceProfile DeviceProfile::fromJson(QJsonObject source) {
void DeviceProfile::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_identification = Jellyfin::Support::fromJsonValue<QSharedPointer<DeviceIdentification>>(source["Identification"]);
m_friendlyName = Jellyfin::Support::fromJsonValue<QString>(source["FriendlyName"]);
m_manufacturer = Jellyfin::Support::fromJsonValue<QString>(source["Manufacturer"]);
m_manufacturerUrl = Jellyfin::Support::fromJsonValue<QString>(source["ManufacturerUrl"]);
m_modelName = Jellyfin::Support::fromJsonValue<QString>(source["ModelName"]);
m_modelDescription = Jellyfin::Support::fromJsonValue<QString>(source["ModelDescription"]);
m_modelNumber = Jellyfin::Support::fromJsonValue<QString>(source["ModelNumber"]);
m_modelUrl = Jellyfin::Support::fromJsonValue<QString>(source["ModelUrl"]);
m_serialNumber = Jellyfin::Support::fromJsonValue<QString>(source["SerialNumber"]);
m_enableAlbumArtInDidl = Jellyfin::Support::fromJsonValue<bool>(source["EnableAlbumArtInDidl"]);
m_enableSingleAlbumArtLimit = Jellyfin::Support::fromJsonValue<bool>(source["EnableSingleAlbumArtLimit"]);
m_enableSingleSubtitleLimit = Jellyfin::Support::fromJsonValue<bool>(source["EnableSingleSubtitleLimit"]);
m_supportedMediaTypes = Jellyfin::Support::fromJsonValue<QString>(source["SupportedMediaTypes"]);
m_userId = Jellyfin::Support::fromJsonValue<QString>(source["UserId"]);
m_albumArtPn = Jellyfin::Support::fromJsonValue<QString>(source["AlbumArtPn"]);
m_maxAlbumArtWidth = Jellyfin::Support::fromJsonValue<qint32>(source["MaxAlbumArtWidth"]);
m_maxAlbumArtHeight = Jellyfin::Support::fromJsonValue<qint32>(source["MaxAlbumArtHeight"]);
m_maxIconWidth = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MaxIconWidth"]);
m_maxIconHeight = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MaxIconHeight"]);
m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MaxStreamingBitrate"]);
m_maxStaticBitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MaxStaticBitrate"]);
m_musicStreamingTranscodingBitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MusicStreamingTranscodingBitrate"]);
m_maxStaticMusicBitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["MaxStaticMusicBitrate"]);
m_sonyAggregationFlags = Jellyfin::Support::fromJsonValue<QString>(source["SonyAggregationFlags"]);
m_protocolInfo = Jellyfin::Support::fromJsonValue<QString>(source["ProtocolInfo"]);
m_timelineOffsetSeconds = Jellyfin::Support::fromJsonValue<qint32>(source["TimelineOffsetSeconds"]);
m_requiresPlainVideoItems = Jellyfin::Support::fromJsonValue<bool>(source["RequiresPlainVideoItems"]);
m_requiresPlainFolders = Jellyfin::Support::fromJsonValue<bool>(source["RequiresPlainFolders"]);
m_enableMSMediaReceiverRegistrar = Jellyfin::Support::fromJsonValue<bool>(source["EnableMSMediaReceiverRegistrar"]);
m_ignoreTranscodeByteRangeRequests = Jellyfin::Support::fromJsonValue<bool>(source["IgnoreTranscodeByteRangeRequests"]);
m_xmlRootAttributes = Jellyfin::Support::fromJsonValue<QList<XmlAttribute>>(source["XmlRootAttributes"]);
m_directPlayProfiles = Jellyfin::Support::fromJsonValue<QList<DirectPlayProfile>>(source["DirectPlayProfiles"]);
m_transcodingProfiles = Jellyfin::Support::fromJsonValue<QList<TranscodingProfile>>(source["TranscodingProfiles"]);
m_containerProfiles = Jellyfin::Support::fromJsonValue<QList<ContainerProfile>>(source["ContainerProfiles"]);
m_codecProfiles = Jellyfin::Support::fromJsonValue<QList<CodecProfile>>(source["CodecProfiles"]);
m_responseProfiles = Jellyfin::Support::fromJsonValue<QList<ResponseProfile>>(source["ResponseProfiles"]);
m_subtitleProfiles = Jellyfin::Support::fromJsonValue<QList<SubtitleProfile>>(source["SubtitleProfiles"]);
}
@ -208,77 +112,6 @@ QJsonObject DeviceProfile::toJson() const {
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
}
result["Identification"] = Jellyfin::Support::toJsonValue<QSharedPointer<DeviceIdentification>>(m_identification);
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);
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);
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);
@ -299,56 +132,11 @@ QJsonObject DeviceProfile::toJson() const {
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);
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);
}
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["SubtitleProfiles"] = Jellyfin::Support::toJsonValue<QList<SubtitleProfile>>(m_subtitleProfiles);
return result;
}
@ -377,211 +165,6 @@ bool DeviceProfile::jellyfinIdNull() const {
void DeviceProfile::setJellyfinIdNull() {
m_jellyfinId.clear();
}
QSharedPointer<DeviceIdentification> DeviceProfile::identification() const { return m_identification; }
void DeviceProfile::setIdentification(QSharedPointer<DeviceIdentification> newIdentification) {
m_identification = newIdentification;
}
QString DeviceProfile::friendlyName() const { return m_friendlyName; }
void DeviceProfile::setFriendlyName(QString newFriendlyName) {
m_friendlyName = newFriendlyName;
}
bool DeviceProfile::friendlyNameNull() const {
return m_friendlyName.isNull();
}
void DeviceProfile::setFriendlyNameNull() {
m_friendlyName.clear();
}
QString DeviceProfile::manufacturer() const { return m_manufacturer; }
void DeviceProfile::setManufacturer(QString newManufacturer) {
m_manufacturer = newManufacturer;
}
bool DeviceProfile::manufacturerNull() const {
return m_manufacturer.isNull();
}
void DeviceProfile::setManufacturerNull() {
m_manufacturer.clear();
}
QString DeviceProfile::manufacturerUrl() const { return m_manufacturerUrl; }
void DeviceProfile::setManufacturerUrl(QString newManufacturerUrl) {
m_manufacturerUrl = newManufacturerUrl;
}
bool DeviceProfile::manufacturerUrlNull() const {
return m_manufacturerUrl.isNull();
}
void DeviceProfile::setManufacturerUrlNull() {
m_manufacturerUrl.clear();
}
QString DeviceProfile::modelName() const { return m_modelName; }
void DeviceProfile::setModelName(QString newModelName) {
m_modelName = newModelName;
}
bool DeviceProfile::modelNameNull() const {
return m_modelName.isNull();
}
void DeviceProfile::setModelNameNull() {
m_modelName.clear();
}
QString DeviceProfile::modelDescription() const { return m_modelDescription; }
void DeviceProfile::setModelDescription(QString newModelDescription) {
m_modelDescription = newModelDescription;
}
bool DeviceProfile::modelDescriptionNull() const {
return m_modelDescription.isNull();
}
void DeviceProfile::setModelDescriptionNull() {
m_modelDescription.clear();
}
QString DeviceProfile::modelNumber() const { return m_modelNumber; }
void DeviceProfile::setModelNumber(QString newModelNumber) {
m_modelNumber = newModelNumber;
}
bool DeviceProfile::modelNumberNull() const {
return m_modelNumber.isNull();
}
void DeviceProfile::setModelNumberNull() {
m_modelNumber.clear();
}
QString DeviceProfile::modelUrl() const { return m_modelUrl; }
void DeviceProfile::setModelUrl(QString newModelUrl) {
m_modelUrl = newModelUrl;
}
bool DeviceProfile::modelUrlNull() const {
return m_modelUrl.isNull();
}
void DeviceProfile::setModelUrlNull() {
m_modelUrl.clear();
}
QString DeviceProfile::serialNumber() const { return m_serialNumber; }
void DeviceProfile::setSerialNumber(QString newSerialNumber) {
m_serialNumber = newSerialNumber;
}
bool DeviceProfile::serialNumberNull() const {
return m_serialNumber.isNull();
}
void DeviceProfile::setSerialNumberNull() {
m_serialNumber.clear();
}
bool DeviceProfile::enableAlbumArtInDidl() const { return m_enableAlbumArtInDidl; }
void DeviceProfile::setEnableAlbumArtInDidl(bool newEnableAlbumArtInDidl) {
m_enableAlbumArtInDidl = newEnableAlbumArtInDidl;
}
bool DeviceProfile::enableSingleAlbumArtLimit() const { return m_enableSingleAlbumArtLimit; }
void DeviceProfile::setEnableSingleAlbumArtLimit(bool newEnableSingleAlbumArtLimit) {
m_enableSingleAlbumArtLimit = newEnableSingleAlbumArtLimit;
}
bool DeviceProfile::enableSingleSubtitleLimit() const { return m_enableSingleSubtitleLimit; }
void DeviceProfile::setEnableSingleSubtitleLimit(bool newEnableSingleSubtitleLimit) {
m_enableSingleSubtitleLimit = newEnableSingleSubtitleLimit;
}
QString DeviceProfile::supportedMediaTypes() const { return m_supportedMediaTypes; }
void DeviceProfile::setSupportedMediaTypes(QString newSupportedMediaTypes) {
m_supportedMediaTypes = newSupportedMediaTypes;
}
bool DeviceProfile::supportedMediaTypesNull() const {
return m_supportedMediaTypes.isNull();
}
void DeviceProfile::setSupportedMediaTypesNull() {
m_supportedMediaTypes.clear();
}
QString DeviceProfile::userId() const { return m_userId; }
void DeviceProfile::setUserId(QString newUserId) {
m_userId = newUserId;
}
bool DeviceProfile::userIdNull() const {
return m_userId.isNull();
}
void DeviceProfile::setUserIdNull() {
m_userId.clear();
}
QString DeviceProfile::albumArtPn() const { return m_albumArtPn; }
void DeviceProfile::setAlbumArtPn(QString newAlbumArtPn) {
m_albumArtPn = newAlbumArtPn;
}
bool DeviceProfile::albumArtPnNull() const {
return m_albumArtPn.isNull();
}
void DeviceProfile::setAlbumArtPnNull() {
m_albumArtPn.clear();
}
qint32 DeviceProfile::maxAlbumArtWidth() const { return m_maxAlbumArtWidth; }
void DeviceProfile::setMaxAlbumArtWidth(qint32 newMaxAlbumArtWidth) {
m_maxAlbumArtWidth = newMaxAlbumArtWidth;
}
qint32 DeviceProfile::maxAlbumArtHeight() const { return m_maxAlbumArtHeight; }
void DeviceProfile::setMaxAlbumArtHeight(qint32 newMaxAlbumArtHeight) {
m_maxAlbumArtHeight = newMaxAlbumArtHeight;
}
std::optional<qint32> DeviceProfile::maxIconWidth() const { return m_maxIconWidth; }
void DeviceProfile::setMaxIconWidth(std::optional<qint32> newMaxIconWidth) {
m_maxIconWidth = newMaxIconWidth;
}
bool DeviceProfile::maxIconWidthNull() const {
return !m_maxIconWidth.has_value();
}
void DeviceProfile::setMaxIconWidthNull() {
m_maxIconWidth = std::nullopt;
}
std::optional<qint32> DeviceProfile::maxIconHeight() const { return m_maxIconHeight; }
void DeviceProfile::setMaxIconHeight(std::optional<qint32> newMaxIconHeight) {
m_maxIconHeight = newMaxIconHeight;
}
bool DeviceProfile::maxIconHeightNull() const {
return !m_maxIconHeight.has_value();
}
void DeviceProfile::setMaxIconHeightNull() {
m_maxIconHeight = std::nullopt;
}
std::optional<qint32> DeviceProfile::maxStreamingBitrate() const { return m_maxStreamingBitrate; }
@ -634,154 +217,37 @@ bool DeviceProfile::maxStaticMusicBitrateNull() const {
void DeviceProfile::setMaxStaticMusicBitrateNull() {
m_maxStaticMusicBitrate = std::nullopt;
}
QString DeviceProfile::sonyAggregationFlags() const { return m_sonyAggregationFlags; }
void DeviceProfile::setSonyAggregationFlags(QString newSonyAggregationFlags) {
m_sonyAggregationFlags = newSonyAggregationFlags;
}
bool DeviceProfile::sonyAggregationFlagsNull() const {
return m_sonyAggregationFlags.isNull();
}
void DeviceProfile::setSonyAggregationFlagsNull() {
m_sonyAggregationFlags.clear();
}
QString DeviceProfile::protocolInfo() const { return m_protocolInfo; }
void DeviceProfile::setProtocolInfo(QString newProtocolInfo) {
m_protocolInfo = newProtocolInfo;
}
bool DeviceProfile::protocolInfoNull() const {
return m_protocolInfo.isNull();
}
void DeviceProfile::setProtocolInfoNull() {
m_protocolInfo.clear();
}
qint32 DeviceProfile::timelineOffsetSeconds() const { return m_timelineOffsetSeconds; }
void DeviceProfile::setTimelineOffsetSeconds(qint32 newTimelineOffsetSeconds) {
m_timelineOffsetSeconds = newTimelineOffsetSeconds;
}
bool DeviceProfile::requiresPlainVideoItems() const { return m_requiresPlainVideoItems; }
void DeviceProfile::setRequiresPlainVideoItems(bool newRequiresPlainVideoItems) {
m_requiresPlainVideoItems = newRequiresPlainVideoItems;
}
bool DeviceProfile::requiresPlainFolders() const { return m_requiresPlainFolders; }
void DeviceProfile::setRequiresPlainFolders(bool newRequiresPlainFolders) {
m_requiresPlainFolders = newRequiresPlainFolders;
}
bool DeviceProfile::enableMSMediaReceiverRegistrar() const { return m_enableMSMediaReceiverRegistrar; }
void DeviceProfile::setEnableMSMediaReceiverRegistrar(bool newEnableMSMediaReceiverRegistrar) {
m_enableMSMediaReceiverRegistrar = newEnableMSMediaReceiverRegistrar;
}
bool DeviceProfile::ignoreTranscodeByteRangeRequests() const { return m_ignoreTranscodeByteRangeRequests; }
void DeviceProfile::setIgnoreTranscodeByteRangeRequests(bool newIgnoreTranscodeByteRangeRequests) {
m_ignoreTranscodeByteRangeRequests = newIgnoreTranscodeByteRangeRequests;
}
QList<XmlAttribute> DeviceProfile::xmlRootAttributes() const { return m_xmlRootAttributes; }
void DeviceProfile::setXmlRootAttributes(QList<XmlAttribute> newXmlRootAttributes) {
m_xmlRootAttributes = newXmlRootAttributes;
}
bool DeviceProfile::xmlRootAttributesNull() const {
return m_xmlRootAttributes.size() == 0;
}
void DeviceProfile::setXmlRootAttributesNull() {
m_xmlRootAttributes.clear();
}
QList<DirectPlayProfile> DeviceProfile::directPlayProfiles() const { return m_directPlayProfiles; }
void DeviceProfile::setDirectPlayProfiles(QList<DirectPlayProfile> newDirectPlayProfiles) {
m_directPlayProfiles = newDirectPlayProfiles;
}
bool DeviceProfile::directPlayProfilesNull() const {
return m_directPlayProfiles.size() == 0;
}
void DeviceProfile::setDirectPlayProfilesNull() {
m_directPlayProfiles.clear();
}
QList<TranscodingProfile> DeviceProfile::transcodingProfiles() const { return m_transcodingProfiles; }
void DeviceProfile::setTranscodingProfiles(QList<TranscodingProfile> newTranscodingProfiles) {
m_transcodingProfiles = newTranscodingProfiles;
}
bool DeviceProfile::transcodingProfilesNull() const {
return m_transcodingProfiles.size() == 0;
}
void DeviceProfile::setTranscodingProfilesNull() {
m_transcodingProfiles.clear();
}
QList<ContainerProfile> DeviceProfile::containerProfiles() const { return m_containerProfiles; }
void DeviceProfile::setContainerProfiles(QList<ContainerProfile> newContainerProfiles) {
m_containerProfiles = newContainerProfiles;
}
bool DeviceProfile::containerProfilesNull() const {
return m_containerProfiles.size() == 0;
}
void DeviceProfile::setContainerProfilesNull() {
m_containerProfiles.clear();
}
QList<CodecProfile> DeviceProfile::codecProfiles() const { return m_codecProfiles; }
void DeviceProfile::setCodecProfiles(QList<CodecProfile> newCodecProfiles) {
m_codecProfiles = newCodecProfiles;
}
bool DeviceProfile::codecProfilesNull() const {
return m_codecProfiles.size() == 0;
}
void DeviceProfile::setCodecProfilesNull() {
m_codecProfiles.clear();
}
QList<ResponseProfile> DeviceProfile::responseProfiles() const { return m_responseProfiles; }
void DeviceProfile::setResponseProfiles(QList<ResponseProfile> newResponseProfiles) {
m_responseProfiles = newResponseProfiles;
}
bool DeviceProfile::responseProfilesNull() const {
return m_responseProfiles.size() == 0;
}
void DeviceProfile::setResponseProfilesNull() {
m_responseProfiles.clear();
}
QList<SubtitleProfile> DeviceProfile::subtitleProfiles() const { return m_subtitleProfiles; }
void DeviceProfile::setSubtitleProfiles(QList<SubtitleProfile> newSubtitleProfiles) {
m_subtitleProfiles = newSubtitleProfiles;
}
bool DeviceProfile::subtitleProfilesNull() const {
return m_subtitleProfiles.size() == 0;
}
void DeviceProfile::setSubtitleProfilesNull() {
m_subtitleProfiles.clear();
}
} // NS DTO

View file

@ -1,138 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceprofileinfo.h>
namespace Jellyfin {
namespace DTO {
DeviceProfileInfo::DeviceProfileInfo() {}
DeviceProfileInfo::DeviceProfileInfo (
DeviceProfileType type
) :
m_type(type) { }
DeviceProfileInfo::DeviceProfileInfo(const DeviceProfileInfo &other) :
m_jellyfinId(other.m_jellyfinId),
m_name(other.m_name),
m_type(other.m_type){}
void DeviceProfileInfo::replaceData(DeviceProfileInfo &other) {
m_jellyfinId = other.m_jellyfinId;
m_name = other.m_name;
m_type = other.m_type;
}
DeviceProfileInfo DeviceProfileInfo::fromJson(QJsonObject source) {
DeviceProfileInfo instance;
instance.setFromJson(source);
return instance;
}
void DeviceProfileInfo::setFromJson(QJsonObject source) {
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_type = Jellyfin::Support::fromJsonValue<DeviceProfileType>(source["Type"]);
}
QJsonObject DeviceProfileInfo::toJson() const {
QJsonObject result;
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;
}
QString DeviceProfileInfo::jellyfinId() const { return m_jellyfinId; }
void DeviceProfileInfo::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
bool DeviceProfileInfo::jellyfinIdNull() const {
return m_jellyfinId.isNull();
}
void DeviceProfileInfo::setJellyfinIdNull() {
m_jellyfinId.clear();
}
QString DeviceProfileInfo::name() const { return m_name; }
void DeviceProfileInfo::setName(QString newName) {
m_name = newName;
}
bool DeviceProfileInfo::nameNull() const {
return m_name.isNull();
}
void DeviceProfileInfo::setNameNull() {
m_name.clear();
}
DeviceProfileType DeviceProfileInfo::type() const { return m_type; }
void DeviceProfileInfo::setType(DeviceProfileType newType) {
m_type = newType;
}
} // NS DTO
namespace Support {
using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo;
template <>
DeviceProfileInfo fromJsonValue(const QJsonValue &source, convertType<DeviceProfileInfo>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceProfileInfo::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceProfileInfo &source, convertType<DeviceProfileInfo>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,8 +34,10 @@ namespace DTO {
DirectPlayProfile::DirectPlayProfile() {}
DirectPlayProfile::DirectPlayProfile (
QString container,
DlnaProfileType type
) :
m_container(container),
m_type(type) { }
@ -73,11 +75,7 @@ void DirectPlayProfile::setFromJson(QJsonObject source) {
QJsonObject DirectPlayProfile::toJson() const {
QJsonObject result;
if (!(m_container.isNull())) {
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
}
result["Container"] = Jellyfin::Support::toJsonValue<QString>(m_container);
if (!(m_audioCodec.isNull())) {
result["AudioCodec"] = Jellyfin::Support::toJsonValue<QString>(m_audioCodec);
@ -97,14 +95,7 @@ QString DirectPlayProfile::container() const { return m_container; }
void DirectPlayProfile::setContainer(QString newContainer) {
m_container = newContainer;
}
bool DirectPlayProfile::containerNull() const {
return m_container.isNull();
}
void DirectPlayProfile::setContainerNull() {
m_container.clear();
}
QString DirectPlayProfile::audioCodec() const { return m_audioCodec; }
void DirectPlayProfile::setAudioCodec(QString newAudioCodec) {

View file

@ -37,6 +37,7 @@ DisplayPreferencesDto::DisplayPreferencesDto (
bool rememberIndexing,
qint32 primaryImageHeight,
qint32 primaryImageWidth,
QJsonObject customPrefs,
ScrollDirection scrollDirection,
bool showBackdrop,
bool rememberSorting,
@ -46,6 +47,7 @@ DisplayPreferencesDto::DisplayPreferencesDto (
m_rememberIndexing(rememberIndexing),
m_primaryImageHeight(primaryImageHeight),
m_primaryImageWidth(primaryImageWidth),
m_customPrefs(customPrefs),
m_scrollDirection(scrollDirection),
m_showBackdrop(showBackdrop),
m_rememberSorting(rememberSorting),
@ -140,11 +142,7 @@ QJsonObject DisplayPreferencesDto::toJson() const {
result["RememberIndexing"] = Jellyfin::Support::toJsonValue<bool>(m_rememberIndexing);
result["PrimaryImageHeight"] = Jellyfin::Support::toJsonValue<qint32>(m_primaryImageHeight);
result["PrimaryImageWidth"] = Jellyfin::Support::toJsonValue<qint32>(m_primaryImageWidth);
if (!(m_customPrefs.isEmpty())) {
result["CustomPrefs"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_customPrefs);
}
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);
@ -233,14 +231,7 @@ QJsonObject DisplayPreferencesDto::customPrefs() const { return m_customPrefs; }
void DisplayPreferencesDto::setCustomPrefs(QJsonObject newCustomPrefs) {
m_customPrefs = newCustomPrefs;
}
bool DisplayPreferencesDto::customPrefsNull() const {
return m_customPrefs.isEmpty();
}
void DisplayPreferencesDto::setCustomPrefsNull() {
m_customPrefs= QJsonObject();
}
ScrollDirection DisplayPreferencesDto::scrollDirection() const { return m_scrollDirection; }
void DisplayPreferencesDto::setScrollDirection(ScrollDirection newScrollDirection) {

View file

@ -54,6 +54,12 @@ DlnaProfileType fromJsonValue(const QJsonValue &source, convertType<DlnaProfileT
if (str == QStringLiteral("Photo")) {
return DlnaProfileType::Photo;
}
if (str == QStringLiteral("Subtitle")) {
return DlnaProfileType::Subtitle;
}
if (str == QStringLiteral("Lyric")) {
return DlnaProfileType::Lyric;
}
return DlnaProfileType::EnumNotSet;
}
@ -67,6 +73,10 @@ QJsonValue toJsonValue(const DlnaProfileType &source, convertType<DlnaProfileTyp
return QStringLiteral("Video");
case DlnaProfileType::Photo:
return QStringLiteral("Photo");
case DlnaProfileType::Subtitle:
return QStringLiteral("Subtitle");
case DlnaProfileType::Lyric:
return QStringLiteral("Lyric");
case DlnaProfileType::EnumNotSet: // Fallthrough
default:

View file

@ -0,0 +1,88 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/downmixstereoalgorithms.h>
namespace Jellyfin {
namespace DTO {
DownMixStereoAlgorithmsClass::DownMixStereoAlgorithmsClass() {}
} // NS DTO
namespace Support {
using DownMixStereoAlgorithms = Jellyfin::DTO::DownMixStereoAlgorithms;
template <>
DownMixStereoAlgorithms fromJsonValue(const QJsonValue &source, convertType<DownMixStereoAlgorithms>) {
if (!source.isString()) return DownMixStereoAlgorithms::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("None")) {
return DownMixStereoAlgorithms::None;
}
if (str == QStringLiteral("Dave750")) {
return DownMixStereoAlgorithms::Dave750;
}
if (str == QStringLiteral("NightmodeDialogue")) {
return DownMixStereoAlgorithms::NightmodeDialogue;
}
if (str == QStringLiteral("Rfc7845")) {
return DownMixStereoAlgorithms::Rfc7845;
}
if (str == QStringLiteral("Ac4")) {
return DownMixStereoAlgorithms::Ac4;
}
return DownMixStereoAlgorithms::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const DownMixStereoAlgorithms &source, convertType<DownMixStereoAlgorithms>) {
switch(source) {
case DownMixStereoAlgorithms::None:
return QStringLiteral("None");
case DownMixStereoAlgorithms::Dave750:
return QStringLiteral("Dave750");
case DownMixStereoAlgorithms::NightmodeDialogue:
return QStringLiteral("NightmodeDialogue");
case DownMixStereoAlgorithms::Rfc7845:
return QStringLiteral("Rfc7845");
case DownMixStereoAlgorithms::Ac4:
return QStringLiteral("Ac4");
case DownMixStereoAlgorithms::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -27,53 +27,53 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/ffmpeglocation.h>
#include <JellyfinQt/dto/embeddedsubtitleoptions.h>
namespace Jellyfin {
namespace DTO {
FFmpegLocationClass::FFmpegLocationClass() {}
EmbeddedSubtitleOptionsClass::EmbeddedSubtitleOptionsClass() {}
} // NS DTO
namespace Support {
using FFmpegLocation = Jellyfin::DTO::FFmpegLocation;
using EmbeddedSubtitleOptions = Jellyfin::DTO::EmbeddedSubtitleOptions;
template <>
FFmpegLocation fromJsonValue(const QJsonValue &source, convertType<FFmpegLocation>) {
if (!source.isString()) return FFmpegLocation::EnumNotSet;
EmbeddedSubtitleOptions fromJsonValue(const QJsonValue &source, convertType<EmbeddedSubtitleOptions>) {
if (!source.isString()) return EmbeddedSubtitleOptions::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("NotFound")) {
return FFmpegLocation::NotFound;
if (str == QStringLiteral("AllowAll")) {
return EmbeddedSubtitleOptions::AllowAll;
}
if (str == QStringLiteral("SetByArgument")) {
return FFmpegLocation::SetByArgument;
if (str == QStringLiteral("AllowText")) {
return EmbeddedSubtitleOptions::AllowText;
}
if (str == QStringLiteral("Custom")) {
return FFmpegLocation::Custom;
if (str == QStringLiteral("AllowImage")) {
return EmbeddedSubtitleOptions::AllowImage;
}
if (str == QStringLiteral("System")) {
return FFmpegLocation::System;
if (str == QStringLiteral("AllowNone")) {
return EmbeddedSubtitleOptions::AllowNone;
}
return FFmpegLocation::EnumNotSet;
return EmbeddedSubtitleOptions::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const FFmpegLocation &source, convertType<FFmpegLocation>) {
QJsonValue toJsonValue(const EmbeddedSubtitleOptions &source, convertType<EmbeddedSubtitleOptions>) {
switch(source) {
case FFmpegLocation::NotFound:
return QStringLiteral("NotFound");
case FFmpegLocation::SetByArgument:
return QStringLiteral("SetByArgument");
case FFmpegLocation::Custom:
return QStringLiteral("Custom");
case FFmpegLocation::System:
return QStringLiteral("System");
case EmbeddedSubtitleOptions::AllowAll:
return QStringLiteral("AllowAll");
case EmbeddedSubtitleOptions::AllowText:
return QStringLiteral("AllowText");
case EmbeddedSubtitleOptions::AllowImage:
return QStringLiteral("AllowImage");
case EmbeddedSubtitleOptions::AllowNone:
return QStringLiteral("AllowNone");
case FFmpegLocation::EnumNotSet: // Fallthrough
case EmbeddedSubtitleOptions::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}

View file

@ -0,0 +1,118 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/encoderpreset.h>
namespace Jellyfin {
namespace DTO {
EncoderPresetClass::EncoderPresetClass() {}
} // NS DTO
namespace Support {
using EncoderPreset = Jellyfin::DTO::EncoderPreset;
template <>
EncoderPreset fromJsonValue(const QJsonValue &source, convertType<EncoderPreset>) {
if (!source.isString()) return EncoderPreset::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("auto")) {
return EncoderPreset::Automatic;
}
if (str == QStringLiteral("placebo")) {
return EncoderPreset::Placebo;
}
if (str == QStringLiteral("veryslow")) {
return EncoderPreset::Veryslow;
}
if (str == QStringLiteral("slower")) {
return EncoderPreset::Slower;
}
if (str == QStringLiteral("slow")) {
return EncoderPreset::Slow;
}
if (str == QStringLiteral("medium")) {
return EncoderPreset::Medium;
}
if (str == QStringLiteral("fast")) {
return EncoderPreset::Fast;
}
if (str == QStringLiteral("faster")) {
return EncoderPreset::Faster;
}
if (str == QStringLiteral("veryfast")) {
return EncoderPreset::Veryfast;
}
if (str == QStringLiteral("superfast")) {
return EncoderPreset::Superfast;
}
if (str == QStringLiteral("ultrafast")) {
return EncoderPreset::Ultrafast;
}
return EncoderPreset::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const EncoderPreset &source, convertType<EncoderPreset>) {
switch(source) {
case EncoderPreset::Automatic:
return QStringLiteral("auto");
case EncoderPreset::Placebo:
return QStringLiteral("placebo");
case EncoderPreset::Veryslow:
return QStringLiteral("veryslow");
case EncoderPreset::Slower:
return QStringLiteral("slower");
case EncoderPreset::Slow:
return QStringLiteral("slow");
case EncoderPreset::Medium:
return QStringLiteral("medium");
case EncoderPreset::Fast:
return QStringLiteral("fast");
case EncoderPreset::Faster:
return QStringLiteral("faster");
case EncoderPreset::Veryfast:
return QStringLiteral("veryfast");
case EncoderPreset::Superfast:
return QStringLiteral("superfast");
case EncoderPreset::Ultrafast:
return QStringLiteral("ultrafast");
case EncoderPreset::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,720 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/encodingoptions.h>
namespace Jellyfin {
namespace DTO {
EncodingOptions::EncodingOptions() {}
EncodingOptions::EncodingOptions (
qint32 encodingThreadCount,
bool enableFallbackFont,
bool enableAudioVbr,
double downMixAudioBoost,
DownMixStereoAlgorithms downMixStereoAlgorithm,
qint32 maxMuxingQueueSize,
bool enableThrottling,
qint32 throttleDelaySeconds,
bool enableSegmentDeletion,
qint32 segmentKeepSeconds,
HardwareAccelerationType hardwareAccelerationType,
bool enableTonemapping,
bool enableVppTonemapping,
bool enableVideoToolboxTonemapping,
TonemappingAlgorithm tonemappingAlgorithm,
TonemappingMode tonemappingMode,
TonemappingRange tonemappingRange,
double tonemappingDesat,
double tonemappingPeak,
double tonemappingParam,
double vppTonemappingBrightness,
double vppTonemappingContrast,
qint32 h264Crf,
qint32 h265Crf,
EncoderPreset encoderPreset,
bool deinterlaceDoubleRate,
DeinterlaceMethod deinterlaceMethod,
bool enableDecodingColorDepth10Hevc,
bool enableDecodingColorDepth10Vp9,
bool enableDecodingColorDepth10HevcRext,
bool enableDecodingColorDepth12HevcRext,
bool enableEnhancedNvdecDecoder,
bool preferSystemNativeHwDecoder,
bool enableIntelLowPowerH264HwEncoder,
bool enableIntelLowPowerHevcHwEncoder,
bool enableHardwareEncoding,
bool allowHevcEncoding,
bool allowAv1Encoding,
bool enableSubtitleExtraction
) :
m_encodingThreadCount(encodingThreadCount),
m_enableFallbackFont(enableFallbackFont),
m_enableAudioVbr(enableAudioVbr),
m_downMixAudioBoost(downMixAudioBoost),
m_downMixStereoAlgorithm(downMixStereoAlgorithm),
m_maxMuxingQueueSize(maxMuxingQueueSize),
m_enableThrottling(enableThrottling),
m_throttleDelaySeconds(throttleDelaySeconds),
m_enableSegmentDeletion(enableSegmentDeletion),
m_segmentKeepSeconds(segmentKeepSeconds),
m_hardwareAccelerationType(hardwareAccelerationType),
m_enableTonemapping(enableTonemapping),
m_enableVppTonemapping(enableVppTonemapping),
m_enableVideoToolboxTonemapping(enableVideoToolboxTonemapping),
m_tonemappingAlgorithm(tonemappingAlgorithm),
m_tonemappingMode(tonemappingMode),
m_tonemappingRange(tonemappingRange),
m_tonemappingDesat(tonemappingDesat),
m_tonemappingPeak(tonemappingPeak),
m_tonemappingParam(tonemappingParam),
m_vppTonemappingBrightness(vppTonemappingBrightness),
m_vppTonemappingContrast(vppTonemappingContrast),
m_h264Crf(h264Crf),
m_h265Crf(h265Crf),
m_encoderPreset(encoderPreset),
m_deinterlaceDoubleRate(deinterlaceDoubleRate),
m_deinterlaceMethod(deinterlaceMethod),
m_enableDecodingColorDepth10Hevc(enableDecodingColorDepth10Hevc),
m_enableDecodingColorDepth10Vp9(enableDecodingColorDepth10Vp9),
m_enableDecodingColorDepth10HevcRext(enableDecodingColorDepth10HevcRext),
m_enableDecodingColorDepth12HevcRext(enableDecodingColorDepth12HevcRext),
m_enableEnhancedNvdecDecoder(enableEnhancedNvdecDecoder),
m_preferSystemNativeHwDecoder(preferSystemNativeHwDecoder),
m_enableIntelLowPowerH264HwEncoder(enableIntelLowPowerH264HwEncoder),
m_enableIntelLowPowerHevcHwEncoder(enableIntelLowPowerHevcHwEncoder),
m_enableHardwareEncoding(enableHardwareEncoding),
m_allowHevcEncoding(allowHevcEncoding),
m_allowAv1Encoding(allowAv1Encoding),
m_enableSubtitleExtraction(enableSubtitleExtraction) { }
EncodingOptions::EncodingOptions(const EncodingOptions &other) :
m_encodingThreadCount(other.m_encodingThreadCount),
m_transcodingTempPath(other.m_transcodingTempPath),
m_fallbackFontPath(other.m_fallbackFontPath),
m_enableFallbackFont(other.m_enableFallbackFont),
m_enableAudioVbr(other.m_enableAudioVbr),
m_downMixAudioBoost(other.m_downMixAudioBoost),
m_downMixStereoAlgorithm(other.m_downMixStereoAlgorithm),
m_maxMuxingQueueSize(other.m_maxMuxingQueueSize),
m_enableThrottling(other.m_enableThrottling),
m_throttleDelaySeconds(other.m_throttleDelaySeconds),
m_enableSegmentDeletion(other.m_enableSegmentDeletion),
m_segmentKeepSeconds(other.m_segmentKeepSeconds),
m_hardwareAccelerationType(other.m_hardwareAccelerationType),
m_encoderAppPath(other.m_encoderAppPath),
m_encoderAppPathDisplay(other.m_encoderAppPathDisplay),
m_vaapiDevice(other.m_vaapiDevice),
m_qsvDevice(other.m_qsvDevice),
m_enableTonemapping(other.m_enableTonemapping),
m_enableVppTonemapping(other.m_enableVppTonemapping),
m_enableVideoToolboxTonemapping(other.m_enableVideoToolboxTonemapping),
m_tonemappingAlgorithm(other.m_tonemappingAlgorithm),
m_tonemappingMode(other.m_tonemappingMode),
m_tonemappingRange(other.m_tonemappingRange),
m_tonemappingDesat(other.m_tonemappingDesat),
m_tonemappingPeak(other.m_tonemappingPeak),
m_tonemappingParam(other.m_tonemappingParam),
m_vppTonemappingBrightness(other.m_vppTonemappingBrightness),
m_vppTonemappingContrast(other.m_vppTonemappingContrast),
m_h264Crf(other.m_h264Crf),
m_h265Crf(other.m_h265Crf),
m_encoderPreset(other.m_encoderPreset),
m_deinterlaceDoubleRate(other.m_deinterlaceDoubleRate),
m_deinterlaceMethod(other.m_deinterlaceMethod),
m_enableDecodingColorDepth10Hevc(other.m_enableDecodingColorDepth10Hevc),
m_enableDecodingColorDepth10Vp9(other.m_enableDecodingColorDepth10Vp9),
m_enableDecodingColorDepth10HevcRext(other.m_enableDecodingColorDepth10HevcRext),
m_enableDecodingColorDepth12HevcRext(other.m_enableDecodingColorDepth12HevcRext),
m_enableEnhancedNvdecDecoder(other.m_enableEnhancedNvdecDecoder),
m_preferSystemNativeHwDecoder(other.m_preferSystemNativeHwDecoder),
m_enableIntelLowPowerH264HwEncoder(other.m_enableIntelLowPowerH264HwEncoder),
m_enableIntelLowPowerHevcHwEncoder(other.m_enableIntelLowPowerHevcHwEncoder),
m_enableHardwareEncoding(other.m_enableHardwareEncoding),
m_allowHevcEncoding(other.m_allowHevcEncoding),
m_allowAv1Encoding(other.m_allowAv1Encoding),
m_enableSubtitleExtraction(other.m_enableSubtitleExtraction),
m_hardwareDecodingCodecs(other.m_hardwareDecodingCodecs),
m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions(other.m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions){}
void EncodingOptions::replaceData(EncodingOptions &other) {
m_encodingThreadCount = other.m_encodingThreadCount;
m_transcodingTempPath = other.m_transcodingTempPath;
m_fallbackFontPath = other.m_fallbackFontPath;
m_enableFallbackFont = other.m_enableFallbackFont;
m_enableAudioVbr = other.m_enableAudioVbr;
m_downMixAudioBoost = other.m_downMixAudioBoost;
m_downMixStereoAlgorithm = other.m_downMixStereoAlgorithm;
m_maxMuxingQueueSize = other.m_maxMuxingQueueSize;
m_enableThrottling = other.m_enableThrottling;
m_throttleDelaySeconds = other.m_throttleDelaySeconds;
m_enableSegmentDeletion = other.m_enableSegmentDeletion;
m_segmentKeepSeconds = other.m_segmentKeepSeconds;
m_hardwareAccelerationType = other.m_hardwareAccelerationType;
m_encoderAppPath = other.m_encoderAppPath;
m_encoderAppPathDisplay = other.m_encoderAppPathDisplay;
m_vaapiDevice = other.m_vaapiDevice;
m_qsvDevice = other.m_qsvDevice;
m_enableTonemapping = other.m_enableTonemapping;
m_enableVppTonemapping = other.m_enableVppTonemapping;
m_enableVideoToolboxTonemapping = other.m_enableVideoToolboxTonemapping;
m_tonemappingAlgorithm = other.m_tonemappingAlgorithm;
m_tonemappingMode = other.m_tonemappingMode;
m_tonemappingRange = other.m_tonemappingRange;
m_tonemappingDesat = other.m_tonemappingDesat;
m_tonemappingPeak = other.m_tonemappingPeak;
m_tonemappingParam = other.m_tonemappingParam;
m_vppTonemappingBrightness = other.m_vppTonemappingBrightness;
m_vppTonemappingContrast = other.m_vppTonemappingContrast;
m_h264Crf = other.m_h264Crf;
m_h265Crf = other.m_h265Crf;
m_encoderPreset = other.m_encoderPreset;
m_deinterlaceDoubleRate = other.m_deinterlaceDoubleRate;
m_deinterlaceMethod = other.m_deinterlaceMethod;
m_enableDecodingColorDepth10Hevc = other.m_enableDecodingColorDepth10Hevc;
m_enableDecodingColorDepth10Vp9 = other.m_enableDecodingColorDepth10Vp9;
m_enableDecodingColorDepth10HevcRext = other.m_enableDecodingColorDepth10HevcRext;
m_enableDecodingColorDepth12HevcRext = other.m_enableDecodingColorDepth12HevcRext;
m_enableEnhancedNvdecDecoder = other.m_enableEnhancedNvdecDecoder;
m_preferSystemNativeHwDecoder = other.m_preferSystemNativeHwDecoder;
m_enableIntelLowPowerH264HwEncoder = other.m_enableIntelLowPowerH264HwEncoder;
m_enableIntelLowPowerHevcHwEncoder = other.m_enableIntelLowPowerHevcHwEncoder;
m_enableHardwareEncoding = other.m_enableHardwareEncoding;
m_allowHevcEncoding = other.m_allowHevcEncoding;
m_allowAv1Encoding = other.m_allowAv1Encoding;
m_enableSubtitleExtraction = other.m_enableSubtitleExtraction;
m_hardwareDecodingCodecs = other.m_hardwareDecodingCodecs;
m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions = other.m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions;
}
EncodingOptions EncodingOptions::fromJson(QJsonObject source) {
EncodingOptions instance;
instance.setFromJson(source);
return instance;
}
void EncodingOptions::setFromJson(QJsonObject source) {
m_encodingThreadCount = Jellyfin::Support::fromJsonValue<qint32>(source["EncodingThreadCount"]);
m_transcodingTempPath = Jellyfin::Support::fromJsonValue<QString>(source["TranscodingTempPath"]);
m_fallbackFontPath = Jellyfin::Support::fromJsonValue<QString>(source["FallbackFontPath"]);
m_enableFallbackFont = Jellyfin::Support::fromJsonValue<bool>(source["EnableFallbackFont"]);
m_enableAudioVbr = Jellyfin::Support::fromJsonValue<bool>(source["EnableAudioVbr"]);
m_downMixAudioBoost = Jellyfin::Support::fromJsonValue<double>(source["DownMixAudioBoost"]);
m_downMixStereoAlgorithm = Jellyfin::Support::fromJsonValue<DownMixStereoAlgorithms>(source["DownMixStereoAlgorithm"]);
m_maxMuxingQueueSize = Jellyfin::Support::fromJsonValue<qint32>(source["MaxMuxingQueueSize"]);
m_enableThrottling = Jellyfin::Support::fromJsonValue<bool>(source["EnableThrottling"]);
m_throttleDelaySeconds = Jellyfin::Support::fromJsonValue<qint32>(source["ThrottleDelaySeconds"]);
m_enableSegmentDeletion = Jellyfin::Support::fromJsonValue<bool>(source["EnableSegmentDeletion"]);
m_segmentKeepSeconds = Jellyfin::Support::fromJsonValue<qint32>(source["SegmentKeepSeconds"]);
m_hardwareAccelerationType = Jellyfin::Support::fromJsonValue<HardwareAccelerationType>(source["HardwareAccelerationType"]);
m_encoderAppPath = Jellyfin::Support::fromJsonValue<QString>(source["EncoderAppPath"]);
m_encoderAppPathDisplay = Jellyfin::Support::fromJsonValue<QString>(source["EncoderAppPathDisplay"]);
m_vaapiDevice = Jellyfin::Support::fromJsonValue<QString>(source["VaapiDevice"]);
m_qsvDevice = Jellyfin::Support::fromJsonValue<QString>(source["QsvDevice"]);
m_enableTonemapping = Jellyfin::Support::fromJsonValue<bool>(source["EnableTonemapping"]);
m_enableVppTonemapping = Jellyfin::Support::fromJsonValue<bool>(source["EnableVppTonemapping"]);
m_enableVideoToolboxTonemapping = Jellyfin::Support::fromJsonValue<bool>(source["EnableVideoToolboxTonemapping"]);
m_tonemappingAlgorithm = Jellyfin::Support::fromJsonValue<TonemappingAlgorithm>(source["TonemappingAlgorithm"]);
m_tonemappingMode = Jellyfin::Support::fromJsonValue<TonemappingMode>(source["TonemappingMode"]);
m_tonemappingRange = Jellyfin::Support::fromJsonValue<TonemappingRange>(source["TonemappingRange"]);
m_tonemappingDesat = Jellyfin::Support::fromJsonValue<double>(source["TonemappingDesat"]);
m_tonemappingPeak = Jellyfin::Support::fromJsonValue<double>(source["TonemappingPeak"]);
m_tonemappingParam = Jellyfin::Support::fromJsonValue<double>(source["TonemappingParam"]);
m_vppTonemappingBrightness = Jellyfin::Support::fromJsonValue<double>(source["VppTonemappingBrightness"]);
m_vppTonemappingContrast = Jellyfin::Support::fromJsonValue<double>(source["VppTonemappingContrast"]);
m_h264Crf = Jellyfin::Support::fromJsonValue<qint32>(source["H264Crf"]);
m_h265Crf = Jellyfin::Support::fromJsonValue<qint32>(source["H265Crf"]);
m_encoderPreset = Jellyfin::Support::fromJsonValue<EncoderPreset>(source["EncoderPreset"]);
m_deinterlaceDoubleRate = Jellyfin::Support::fromJsonValue<bool>(source["DeinterlaceDoubleRate"]);
m_deinterlaceMethod = Jellyfin::Support::fromJsonValue<DeinterlaceMethod>(source["DeinterlaceMethod"]);
m_enableDecodingColorDepth10Hevc = Jellyfin::Support::fromJsonValue<bool>(source["EnableDecodingColorDepth10Hevc"]);
m_enableDecodingColorDepth10Vp9 = Jellyfin::Support::fromJsonValue<bool>(source["EnableDecodingColorDepth10Vp9"]);
m_enableDecodingColorDepth10HevcRext = Jellyfin::Support::fromJsonValue<bool>(source["EnableDecodingColorDepth10HevcRext"]);
m_enableDecodingColorDepth12HevcRext = Jellyfin::Support::fromJsonValue<bool>(source["EnableDecodingColorDepth12HevcRext"]);
m_enableEnhancedNvdecDecoder = Jellyfin::Support::fromJsonValue<bool>(source["EnableEnhancedNvdecDecoder"]);
m_preferSystemNativeHwDecoder = Jellyfin::Support::fromJsonValue<bool>(source["PreferSystemNativeHwDecoder"]);
m_enableIntelLowPowerH264HwEncoder = Jellyfin::Support::fromJsonValue<bool>(source["EnableIntelLowPowerH264HwEncoder"]);
m_enableIntelLowPowerHevcHwEncoder = Jellyfin::Support::fromJsonValue<bool>(source["EnableIntelLowPowerHevcHwEncoder"]);
m_enableHardwareEncoding = Jellyfin::Support::fromJsonValue<bool>(source["EnableHardwareEncoding"]);
m_allowHevcEncoding = Jellyfin::Support::fromJsonValue<bool>(source["AllowHevcEncoding"]);
m_allowAv1Encoding = Jellyfin::Support::fromJsonValue<bool>(source["AllowAv1Encoding"]);
m_enableSubtitleExtraction = Jellyfin::Support::fromJsonValue<bool>(source["EnableSubtitleExtraction"]);
m_hardwareDecodingCodecs = Jellyfin::Support::fromJsonValue<QStringList>(source["HardwareDecodingCodecs"]);
m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions = Jellyfin::Support::fromJsonValue<QStringList>(source["AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"]);
}
QJsonObject EncodingOptions::toJson() const {
QJsonObject result;
result["EncodingThreadCount"] = Jellyfin::Support::toJsonValue<qint32>(m_encodingThreadCount);
if (!(m_transcodingTempPath.isNull())) {
result["TranscodingTempPath"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingTempPath);
}
if (!(m_fallbackFontPath.isNull())) {
result["FallbackFontPath"] = Jellyfin::Support::toJsonValue<QString>(m_fallbackFontPath);
}
result["EnableFallbackFont"] = Jellyfin::Support::toJsonValue<bool>(m_enableFallbackFont);
result["EnableAudioVbr"] = Jellyfin::Support::toJsonValue<bool>(m_enableAudioVbr);
result["DownMixAudioBoost"] = Jellyfin::Support::toJsonValue<double>(m_downMixAudioBoost);
result["DownMixStereoAlgorithm"] = Jellyfin::Support::toJsonValue<DownMixStereoAlgorithms>(m_downMixStereoAlgorithm);
result["MaxMuxingQueueSize"] = Jellyfin::Support::toJsonValue<qint32>(m_maxMuxingQueueSize);
result["EnableThrottling"] = Jellyfin::Support::toJsonValue<bool>(m_enableThrottling);
result["ThrottleDelaySeconds"] = Jellyfin::Support::toJsonValue<qint32>(m_throttleDelaySeconds);
result["EnableSegmentDeletion"] = Jellyfin::Support::toJsonValue<bool>(m_enableSegmentDeletion);
result["SegmentKeepSeconds"] = Jellyfin::Support::toJsonValue<qint32>(m_segmentKeepSeconds);
result["HardwareAccelerationType"] = Jellyfin::Support::toJsonValue<HardwareAccelerationType>(m_hardwareAccelerationType);
if (!(m_encoderAppPath.isNull())) {
result["EncoderAppPath"] = Jellyfin::Support::toJsonValue<QString>(m_encoderAppPath);
}
if (!(m_encoderAppPathDisplay.isNull())) {
result["EncoderAppPathDisplay"] = Jellyfin::Support::toJsonValue<QString>(m_encoderAppPathDisplay);
}
if (!(m_vaapiDevice.isNull())) {
result["VaapiDevice"] = Jellyfin::Support::toJsonValue<QString>(m_vaapiDevice);
}
if (!(m_qsvDevice.isNull())) {
result["QsvDevice"] = Jellyfin::Support::toJsonValue<QString>(m_qsvDevice);
}
result["EnableTonemapping"] = Jellyfin::Support::toJsonValue<bool>(m_enableTonemapping);
result["EnableVppTonemapping"] = Jellyfin::Support::toJsonValue<bool>(m_enableVppTonemapping);
result["EnableVideoToolboxTonemapping"] = Jellyfin::Support::toJsonValue<bool>(m_enableVideoToolboxTonemapping);
result["TonemappingAlgorithm"] = Jellyfin::Support::toJsonValue<TonemappingAlgorithm>(m_tonemappingAlgorithm);
result["TonemappingMode"] = Jellyfin::Support::toJsonValue<TonemappingMode>(m_tonemappingMode);
result["TonemappingRange"] = Jellyfin::Support::toJsonValue<TonemappingRange>(m_tonemappingRange);
result["TonemappingDesat"] = Jellyfin::Support::toJsonValue<double>(m_tonemappingDesat);
result["TonemappingPeak"] = Jellyfin::Support::toJsonValue<double>(m_tonemappingPeak);
result["TonemappingParam"] = Jellyfin::Support::toJsonValue<double>(m_tonemappingParam);
result["VppTonemappingBrightness"] = Jellyfin::Support::toJsonValue<double>(m_vppTonemappingBrightness);
result["VppTonemappingContrast"] = Jellyfin::Support::toJsonValue<double>(m_vppTonemappingContrast);
result["H264Crf"] = Jellyfin::Support::toJsonValue<qint32>(m_h264Crf);
result["H265Crf"] = Jellyfin::Support::toJsonValue<qint32>(m_h265Crf);
result["EncoderPreset"] = Jellyfin::Support::toJsonValue<EncoderPreset>(m_encoderPreset);
result["DeinterlaceDoubleRate"] = Jellyfin::Support::toJsonValue<bool>(m_deinterlaceDoubleRate);
result["DeinterlaceMethod"] = Jellyfin::Support::toJsonValue<DeinterlaceMethod>(m_deinterlaceMethod);
result["EnableDecodingColorDepth10Hevc"] = Jellyfin::Support::toJsonValue<bool>(m_enableDecodingColorDepth10Hevc);
result["EnableDecodingColorDepth10Vp9"] = Jellyfin::Support::toJsonValue<bool>(m_enableDecodingColorDepth10Vp9);
result["EnableDecodingColorDepth10HevcRext"] = Jellyfin::Support::toJsonValue<bool>(m_enableDecodingColorDepth10HevcRext);
result["EnableDecodingColorDepth12HevcRext"] = Jellyfin::Support::toJsonValue<bool>(m_enableDecodingColorDepth12HevcRext);
result["EnableEnhancedNvdecDecoder"] = Jellyfin::Support::toJsonValue<bool>(m_enableEnhancedNvdecDecoder);
result["PreferSystemNativeHwDecoder"] = Jellyfin::Support::toJsonValue<bool>(m_preferSystemNativeHwDecoder);
result["EnableIntelLowPowerH264HwEncoder"] = Jellyfin::Support::toJsonValue<bool>(m_enableIntelLowPowerH264HwEncoder);
result["EnableIntelLowPowerHevcHwEncoder"] = Jellyfin::Support::toJsonValue<bool>(m_enableIntelLowPowerHevcHwEncoder);
result["EnableHardwareEncoding"] = Jellyfin::Support::toJsonValue<bool>(m_enableHardwareEncoding);
result["AllowHevcEncoding"] = Jellyfin::Support::toJsonValue<bool>(m_allowHevcEncoding);
result["AllowAv1Encoding"] = Jellyfin::Support::toJsonValue<bool>(m_allowAv1Encoding);
result["EnableSubtitleExtraction"] = Jellyfin::Support::toJsonValue<bool>(m_enableSubtitleExtraction);
if (!(m_hardwareDecodingCodecs.size() == 0)) {
result["HardwareDecodingCodecs"] = Jellyfin::Support::toJsonValue<QStringList>(m_hardwareDecodingCodecs);
}
if (!(m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions.size() == 0)) {
result["AllowOnDemandMetadataBasedKeyframeExtractionForExtensions"] = Jellyfin::Support::toJsonValue<QStringList>(m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions);
}
return result;
}
qint32 EncodingOptions::encodingThreadCount() const { return m_encodingThreadCount; }
void EncodingOptions::setEncodingThreadCount(qint32 newEncodingThreadCount) {
m_encodingThreadCount = newEncodingThreadCount;
}
QString EncodingOptions::transcodingTempPath() const { return m_transcodingTempPath; }
void EncodingOptions::setTranscodingTempPath(QString newTranscodingTempPath) {
m_transcodingTempPath = newTranscodingTempPath;
}
bool EncodingOptions::transcodingTempPathNull() const {
return m_transcodingTempPath.isNull();
}
void EncodingOptions::setTranscodingTempPathNull() {
m_transcodingTempPath.clear();
}
QString EncodingOptions::fallbackFontPath() const { return m_fallbackFontPath; }
void EncodingOptions::setFallbackFontPath(QString newFallbackFontPath) {
m_fallbackFontPath = newFallbackFontPath;
}
bool EncodingOptions::fallbackFontPathNull() const {
return m_fallbackFontPath.isNull();
}
void EncodingOptions::setFallbackFontPathNull() {
m_fallbackFontPath.clear();
}
bool EncodingOptions::enableFallbackFont() const { return m_enableFallbackFont; }
void EncodingOptions::setEnableFallbackFont(bool newEnableFallbackFont) {
m_enableFallbackFont = newEnableFallbackFont;
}
bool EncodingOptions::enableAudioVbr() const { return m_enableAudioVbr; }
void EncodingOptions::setEnableAudioVbr(bool newEnableAudioVbr) {
m_enableAudioVbr = newEnableAudioVbr;
}
double EncodingOptions::downMixAudioBoost() const { return m_downMixAudioBoost; }
void EncodingOptions::setDownMixAudioBoost(double newDownMixAudioBoost) {
m_downMixAudioBoost = newDownMixAudioBoost;
}
DownMixStereoAlgorithms EncodingOptions::downMixStereoAlgorithm() const { return m_downMixStereoAlgorithm; }
void EncodingOptions::setDownMixStereoAlgorithm(DownMixStereoAlgorithms newDownMixStereoAlgorithm) {
m_downMixStereoAlgorithm = newDownMixStereoAlgorithm;
}
qint32 EncodingOptions::maxMuxingQueueSize() const { return m_maxMuxingQueueSize; }
void EncodingOptions::setMaxMuxingQueueSize(qint32 newMaxMuxingQueueSize) {
m_maxMuxingQueueSize = newMaxMuxingQueueSize;
}
bool EncodingOptions::enableThrottling() const { return m_enableThrottling; }
void EncodingOptions::setEnableThrottling(bool newEnableThrottling) {
m_enableThrottling = newEnableThrottling;
}
qint32 EncodingOptions::throttleDelaySeconds() const { return m_throttleDelaySeconds; }
void EncodingOptions::setThrottleDelaySeconds(qint32 newThrottleDelaySeconds) {
m_throttleDelaySeconds = newThrottleDelaySeconds;
}
bool EncodingOptions::enableSegmentDeletion() const { return m_enableSegmentDeletion; }
void EncodingOptions::setEnableSegmentDeletion(bool newEnableSegmentDeletion) {
m_enableSegmentDeletion = newEnableSegmentDeletion;
}
qint32 EncodingOptions::segmentKeepSeconds() const { return m_segmentKeepSeconds; }
void EncodingOptions::setSegmentKeepSeconds(qint32 newSegmentKeepSeconds) {
m_segmentKeepSeconds = newSegmentKeepSeconds;
}
HardwareAccelerationType EncodingOptions::hardwareAccelerationType() const { return m_hardwareAccelerationType; }
void EncodingOptions::setHardwareAccelerationType(HardwareAccelerationType newHardwareAccelerationType) {
m_hardwareAccelerationType = newHardwareAccelerationType;
}
QString EncodingOptions::encoderAppPath() const { return m_encoderAppPath; }
void EncodingOptions::setEncoderAppPath(QString newEncoderAppPath) {
m_encoderAppPath = newEncoderAppPath;
}
bool EncodingOptions::encoderAppPathNull() const {
return m_encoderAppPath.isNull();
}
void EncodingOptions::setEncoderAppPathNull() {
m_encoderAppPath.clear();
}
QString EncodingOptions::encoderAppPathDisplay() const { return m_encoderAppPathDisplay; }
void EncodingOptions::setEncoderAppPathDisplay(QString newEncoderAppPathDisplay) {
m_encoderAppPathDisplay = newEncoderAppPathDisplay;
}
bool EncodingOptions::encoderAppPathDisplayNull() const {
return m_encoderAppPathDisplay.isNull();
}
void EncodingOptions::setEncoderAppPathDisplayNull() {
m_encoderAppPathDisplay.clear();
}
QString EncodingOptions::vaapiDevice() const { return m_vaapiDevice; }
void EncodingOptions::setVaapiDevice(QString newVaapiDevice) {
m_vaapiDevice = newVaapiDevice;
}
bool EncodingOptions::vaapiDeviceNull() const {
return m_vaapiDevice.isNull();
}
void EncodingOptions::setVaapiDeviceNull() {
m_vaapiDevice.clear();
}
QString EncodingOptions::qsvDevice() const { return m_qsvDevice; }
void EncodingOptions::setQsvDevice(QString newQsvDevice) {
m_qsvDevice = newQsvDevice;
}
bool EncodingOptions::qsvDeviceNull() const {
return m_qsvDevice.isNull();
}
void EncodingOptions::setQsvDeviceNull() {
m_qsvDevice.clear();
}
bool EncodingOptions::enableTonemapping() const { return m_enableTonemapping; }
void EncodingOptions::setEnableTonemapping(bool newEnableTonemapping) {
m_enableTonemapping = newEnableTonemapping;
}
bool EncodingOptions::enableVppTonemapping() const { return m_enableVppTonemapping; }
void EncodingOptions::setEnableVppTonemapping(bool newEnableVppTonemapping) {
m_enableVppTonemapping = newEnableVppTonemapping;
}
bool EncodingOptions::enableVideoToolboxTonemapping() const { return m_enableVideoToolboxTonemapping; }
void EncodingOptions::setEnableVideoToolboxTonemapping(bool newEnableVideoToolboxTonemapping) {
m_enableVideoToolboxTonemapping = newEnableVideoToolboxTonemapping;
}
TonemappingAlgorithm EncodingOptions::tonemappingAlgorithm() const { return m_tonemappingAlgorithm; }
void EncodingOptions::setTonemappingAlgorithm(TonemappingAlgorithm newTonemappingAlgorithm) {
m_tonemappingAlgorithm = newTonemappingAlgorithm;
}
TonemappingMode EncodingOptions::tonemappingMode() const { return m_tonemappingMode; }
void EncodingOptions::setTonemappingMode(TonemappingMode newTonemappingMode) {
m_tonemappingMode = newTonemappingMode;
}
TonemappingRange EncodingOptions::tonemappingRange() const { return m_tonemappingRange; }
void EncodingOptions::setTonemappingRange(TonemappingRange newTonemappingRange) {
m_tonemappingRange = newTonemappingRange;
}
double EncodingOptions::tonemappingDesat() const { return m_tonemappingDesat; }
void EncodingOptions::setTonemappingDesat(double newTonemappingDesat) {
m_tonemappingDesat = newTonemappingDesat;
}
double EncodingOptions::tonemappingPeak() const { return m_tonemappingPeak; }
void EncodingOptions::setTonemappingPeak(double newTonemappingPeak) {
m_tonemappingPeak = newTonemappingPeak;
}
double EncodingOptions::tonemappingParam() const { return m_tonemappingParam; }
void EncodingOptions::setTonemappingParam(double newTonemappingParam) {
m_tonemappingParam = newTonemappingParam;
}
double EncodingOptions::vppTonemappingBrightness() const { return m_vppTonemappingBrightness; }
void EncodingOptions::setVppTonemappingBrightness(double newVppTonemappingBrightness) {
m_vppTonemappingBrightness = newVppTonemappingBrightness;
}
double EncodingOptions::vppTonemappingContrast() const { return m_vppTonemappingContrast; }
void EncodingOptions::setVppTonemappingContrast(double newVppTonemappingContrast) {
m_vppTonemappingContrast = newVppTonemappingContrast;
}
qint32 EncodingOptions::h264Crf() const { return m_h264Crf; }
void EncodingOptions::setH264Crf(qint32 newH264Crf) {
m_h264Crf = newH264Crf;
}
qint32 EncodingOptions::h265Crf() const { return m_h265Crf; }
void EncodingOptions::setH265Crf(qint32 newH265Crf) {
m_h265Crf = newH265Crf;
}
EncoderPreset EncodingOptions::encoderPreset() const { return m_encoderPreset; }
void EncodingOptions::setEncoderPreset(EncoderPreset newEncoderPreset) {
m_encoderPreset = newEncoderPreset;
}
bool EncodingOptions::deinterlaceDoubleRate() const { return m_deinterlaceDoubleRate; }
void EncodingOptions::setDeinterlaceDoubleRate(bool newDeinterlaceDoubleRate) {
m_deinterlaceDoubleRate = newDeinterlaceDoubleRate;
}
DeinterlaceMethod EncodingOptions::deinterlaceMethod() const { return m_deinterlaceMethod; }
void EncodingOptions::setDeinterlaceMethod(DeinterlaceMethod newDeinterlaceMethod) {
m_deinterlaceMethod = newDeinterlaceMethod;
}
bool EncodingOptions::enableDecodingColorDepth10Hevc() const { return m_enableDecodingColorDepth10Hevc; }
void EncodingOptions::setEnableDecodingColorDepth10Hevc(bool newEnableDecodingColorDepth10Hevc) {
m_enableDecodingColorDepth10Hevc = newEnableDecodingColorDepth10Hevc;
}
bool EncodingOptions::enableDecodingColorDepth10Vp9() const { return m_enableDecodingColorDepth10Vp9; }
void EncodingOptions::setEnableDecodingColorDepth10Vp9(bool newEnableDecodingColorDepth10Vp9) {
m_enableDecodingColorDepth10Vp9 = newEnableDecodingColorDepth10Vp9;
}
bool EncodingOptions::enableDecodingColorDepth10HevcRext() const { return m_enableDecodingColorDepth10HevcRext; }
void EncodingOptions::setEnableDecodingColorDepth10HevcRext(bool newEnableDecodingColorDepth10HevcRext) {
m_enableDecodingColorDepth10HevcRext = newEnableDecodingColorDepth10HevcRext;
}
bool EncodingOptions::enableDecodingColorDepth12HevcRext() const { return m_enableDecodingColorDepth12HevcRext; }
void EncodingOptions::setEnableDecodingColorDepth12HevcRext(bool newEnableDecodingColorDepth12HevcRext) {
m_enableDecodingColorDepth12HevcRext = newEnableDecodingColorDepth12HevcRext;
}
bool EncodingOptions::enableEnhancedNvdecDecoder() const { return m_enableEnhancedNvdecDecoder; }
void EncodingOptions::setEnableEnhancedNvdecDecoder(bool newEnableEnhancedNvdecDecoder) {
m_enableEnhancedNvdecDecoder = newEnableEnhancedNvdecDecoder;
}
bool EncodingOptions::preferSystemNativeHwDecoder() const { return m_preferSystemNativeHwDecoder; }
void EncodingOptions::setPreferSystemNativeHwDecoder(bool newPreferSystemNativeHwDecoder) {
m_preferSystemNativeHwDecoder = newPreferSystemNativeHwDecoder;
}
bool EncodingOptions::enableIntelLowPowerH264HwEncoder() const { return m_enableIntelLowPowerH264HwEncoder; }
void EncodingOptions::setEnableIntelLowPowerH264HwEncoder(bool newEnableIntelLowPowerH264HwEncoder) {
m_enableIntelLowPowerH264HwEncoder = newEnableIntelLowPowerH264HwEncoder;
}
bool EncodingOptions::enableIntelLowPowerHevcHwEncoder() const { return m_enableIntelLowPowerHevcHwEncoder; }
void EncodingOptions::setEnableIntelLowPowerHevcHwEncoder(bool newEnableIntelLowPowerHevcHwEncoder) {
m_enableIntelLowPowerHevcHwEncoder = newEnableIntelLowPowerHevcHwEncoder;
}
bool EncodingOptions::enableHardwareEncoding() const { return m_enableHardwareEncoding; }
void EncodingOptions::setEnableHardwareEncoding(bool newEnableHardwareEncoding) {
m_enableHardwareEncoding = newEnableHardwareEncoding;
}
bool EncodingOptions::allowHevcEncoding() const { return m_allowHevcEncoding; }
void EncodingOptions::setAllowHevcEncoding(bool newAllowHevcEncoding) {
m_allowHevcEncoding = newAllowHevcEncoding;
}
bool EncodingOptions::allowAv1Encoding() const { return m_allowAv1Encoding; }
void EncodingOptions::setAllowAv1Encoding(bool newAllowAv1Encoding) {
m_allowAv1Encoding = newAllowAv1Encoding;
}
bool EncodingOptions::enableSubtitleExtraction() const { return m_enableSubtitleExtraction; }
void EncodingOptions::setEnableSubtitleExtraction(bool newEnableSubtitleExtraction) {
m_enableSubtitleExtraction = newEnableSubtitleExtraction;
}
QStringList EncodingOptions::hardwareDecodingCodecs() const { return m_hardwareDecodingCodecs; }
void EncodingOptions::setHardwareDecodingCodecs(QStringList newHardwareDecodingCodecs) {
m_hardwareDecodingCodecs = newHardwareDecodingCodecs;
}
bool EncodingOptions::hardwareDecodingCodecsNull() const {
return m_hardwareDecodingCodecs.size() == 0;
}
void EncodingOptions::setHardwareDecodingCodecsNull() {
m_hardwareDecodingCodecs.clear();
}
QStringList EncodingOptions::allowOnDemandMetadataBasedKeyframeExtractionForExtensions() const { return m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions; }
void EncodingOptions::setAllowOnDemandMetadataBasedKeyframeExtractionForExtensions(QStringList newAllowOnDemandMetadataBasedKeyframeExtractionForExtensions) {
m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions = newAllowOnDemandMetadataBasedKeyframeExtractionForExtensions;
}
bool EncodingOptions::allowOnDemandMetadataBasedKeyframeExtractionForExtensionsNull() const {
return m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions.size() == 0;
}
void EncodingOptions::setAllowOnDemandMetadataBasedKeyframeExtractionForExtensionsNull() {
m_allowOnDemandMetadataBasedKeyframeExtractionForExtensions.clear();
}
} // NS DTO
namespace Support {
using EncodingOptions = Jellyfin::DTO::EncodingOptions;
template <>
EncodingOptions fromJsonValue(const QJsonValue &source, convertType<EncodingOptions>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return EncodingOptions::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const EncodingOptions &source, convertType<EncodingOptions>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,8 +34,12 @@ namespace DTO {
ExternalIdInfo::ExternalIdInfo() {}
ExternalIdInfo::ExternalIdInfo (
QString name,
QString key,
ExternalIdMediaType type
) :
m_name(name),
m_key(key),
m_type(type) { }
@ -73,16 +77,8 @@ void ExternalIdInfo::setFromJson(QJsonObject source) {
QJsonObject ExternalIdInfo::toJson() const {
QJsonObject result;
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["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Key"] = Jellyfin::Support::toJsonValue<QString>(m_key);
result["Type"] = Jellyfin::Support::toJsonValue<ExternalIdMediaType>(m_type);
if (!(m_urlFormatString.isNull())) {
@ -97,27 +93,13 @@ QString ExternalIdInfo::name() const { return m_name; }
void ExternalIdInfo::setName(QString newName) {
m_name = newName;
}
bool ExternalIdInfo::nameNull() const {
return m_name.isNull();
}
void ExternalIdInfo::setNameNull() {
m_name.clear();
}
QString ExternalIdInfo::key() const { return m_key; }
void ExternalIdInfo::setKey(QString newKey) {
m_key = newKey;
}
bool ExternalIdInfo::keyNull() const {
return m_key.isNull();
}
void ExternalIdInfo::setKeyNull() {
m_key.clear();
}
ExternalIdMediaType ExternalIdInfo::type() const { return m_type; }
void ExternalIdInfo::setType(ExternalIdMediaType newType) {

View file

@ -81,6 +81,9 @@ ExternalIdMediaType fromJsonValue(const QJsonValue &source, convertType<External
if (str == QStringLiteral("Track")) {
return ExternalIdMediaType::Track;
}
if (str == QStringLiteral("Book")) {
return ExternalIdMediaType::Book;
}
return ExternalIdMediaType::EnumNotSet;
}
@ -112,6 +115,8 @@ QJsonValue toJsonValue(const ExternalIdMediaType &source, convertType<ExternalId
return QStringLiteral("Series");
case ExternalIdMediaType::Track:
return QStringLiteral("Track");
case ExternalIdMediaType::Book:
return QStringLiteral("Book");
case ExternalIdMediaType::EnumNotSet: // Fallthrough
default:

123
core/src/dto/extratype.cpp Normal file
View file

@ -0,0 +1,123 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/extratype.h>
namespace Jellyfin {
namespace DTO {
ExtraTypeClass::ExtraTypeClass() {}
} // NS DTO
namespace Support {
using ExtraType = Jellyfin::DTO::ExtraType;
template <>
ExtraType fromJsonValue(const QJsonValue &source, convertType<ExtraType>) {
if (!source.isString()) return ExtraType::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Unknown")) {
return ExtraType::Unknown;
}
if (str == QStringLiteral("Clip")) {
return ExtraType::Clip;
}
if (str == QStringLiteral("Trailer")) {
return ExtraType::Trailer;
}
if (str == QStringLiteral("BehindTheScenes")) {
return ExtraType::BehindTheScenes;
}
if (str == QStringLiteral("DeletedScene")) {
return ExtraType::DeletedScene;
}
if (str == QStringLiteral("Interview")) {
return ExtraType::Interview;
}
if (str == QStringLiteral("Scene")) {
return ExtraType::Scene;
}
if (str == QStringLiteral("Sample")) {
return ExtraType::Sample;
}
if (str == QStringLiteral("ThemeSong")) {
return ExtraType::ThemeSong;
}
if (str == QStringLiteral("ThemeVideo")) {
return ExtraType::ThemeVideo;
}
if (str == QStringLiteral("Featurette")) {
return ExtraType::Featurette;
}
if (str == QStringLiteral("Short")) {
return ExtraType::Short;
}
return ExtraType::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const ExtraType &source, convertType<ExtraType>) {
switch(source) {
case ExtraType::Unknown:
return QStringLiteral("Unknown");
case ExtraType::Clip:
return QStringLiteral("Clip");
case ExtraType::Trailer:
return QStringLiteral("Trailer");
case ExtraType::BehindTheScenes:
return QStringLiteral("BehindTheScenes");
case ExtraType::DeletedScene:
return QStringLiteral("DeletedScene");
case ExtraType::Interview:
return QStringLiteral("Interview");
case ExtraType::Scene:
return QStringLiteral("Scene");
case ExtraType::Sample:
return QStringLiteral("Sample");
case ExtraType::ThemeSong:
return QStringLiteral("ThemeSong");
case ExtraType::ThemeVideo:
return QStringLiteral("ThemeVideo");
case ExtraType::Featurette:
return QStringLiteral("Featurette");
case ExtraType::Short:
return QStringLiteral("Short");
case ExtraType::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,8 +34,12 @@ namespace DTO {
FileSystemEntryInfo::FileSystemEntryInfo() {}
FileSystemEntryInfo::FileSystemEntryInfo (
QString name,
QString path,
FileSystemEntryType type
) :
m_name(name),
m_path(path),
m_type(type) { }
@ -70,16 +74,8 @@ void FileSystemEntryInfo::setFromJson(QJsonObject source) {
QJsonObject FileSystemEntryInfo::toJson() const {
QJsonObject result;
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["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
result["Type"] = Jellyfin::Support::toJsonValue<FileSystemEntryType>(m_type);
return result;
}
@ -89,27 +85,13 @@ QString FileSystemEntryInfo::name() const { return m_name; }
void FileSystemEntryInfo::setName(QString newName) {
m_name = newName;
}
bool FileSystemEntryInfo::nameNull() const {
return m_name.isNull();
}
void FileSystemEntryInfo::setNameNull() {
m_name.clear();
}
QString FileSystemEntryInfo::path() const { return m_path; }
void FileSystemEntryInfo::setPath(QString newPath) {
m_path = newPath;
}
bool FileSystemEntryInfo::pathNull() const {
return m_path.isNull();
}
void FileSystemEntryInfo::setPathNull() {
m_path.clear();
}
FileSystemEntryType FileSystemEntryInfo::type() const { return m_type; }
void FileSystemEntryInfo::setType(FileSystemEntryType newType) {

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/forcekeepalivemessage.h>
namespace Jellyfin {
namespace DTO {
ForceKeepAliveMessage::ForceKeepAliveMessage() {}
ForceKeepAliveMessage::ForceKeepAliveMessage (
qint32 data,
QString messageId,
SessionMessageType messageType
) :
m_data(data),
m_messageId(messageId),
m_messageType(messageType) { }
ForceKeepAliveMessage::ForceKeepAliveMessage(const ForceKeepAliveMessage &other) :
m_data(other.m_data),
m_messageId(other.m_messageId),
m_messageType(other.m_messageType){}
void ForceKeepAliveMessage::replaceData(ForceKeepAliveMessage &other) {
m_data = other.m_data;
m_messageId = other.m_messageId;
m_messageType = other.m_messageType;
}
ForceKeepAliveMessage ForceKeepAliveMessage::fromJson(QJsonObject source) {
ForceKeepAliveMessage instance;
instance.setFromJson(source);
return instance;
}
void ForceKeepAliveMessage::setFromJson(QJsonObject source) {
m_data = Jellyfin::Support::fromJsonValue<qint32>(source["Data"]);
m_messageId = Jellyfin::Support::fromJsonValue<QString>(source["MessageId"]);
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject ForceKeepAliveMessage::toJson() const {
QJsonObject result;
result["Data"] = Jellyfin::Support::toJsonValue<qint32>(m_data);
result["MessageId"] = Jellyfin::Support::toJsonValue<QString>(m_messageId);
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
qint32 ForceKeepAliveMessage::data() const { return m_data; }
void ForceKeepAliveMessage::setData(qint32 newData) {
m_data = newData;
}
QString ForceKeepAliveMessage::messageId() const { return m_messageId; }
void ForceKeepAliveMessage::setMessageId(QString newMessageId) {
m_messageId = newMessageId;
}
SessionMessageType ForceKeepAliveMessage::messageType() const { return m_messageType; }
void ForceKeepAliveMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using ForceKeepAliveMessage = Jellyfin::DTO::ForceKeepAliveMessage;
template <>
ForceKeepAliveMessage fromJsonValue(const QJsonValue &source, convertType<ForceKeepAliveMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ForceKeepAliveMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ForceKeepAliveMessage &source, convertType<ForceKeepAliveMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -27,73 +27,68 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/deviceoptions.h>
#include <JellyfinQt/dto/forgotpasswordpindto.h>
namespace Jellyfin {
namespace DTO {
DeviceOptions::DeviceOptions() {}
DeviceOptions::DeviceOptions(const DeviceOptions &other) :
m_customName(other.m_customName){}
ForgotPasswordPinDto::ForgotPasswordPinDto() {}
ForgotPasswordPinDto::ForgotPasswordPinDto (
QString pin
) :
m_pin(pin) { }
void DeviceOptions::replaceData(DeviceOptions &other) {
m_customName = other.m_customName;
ForgotPasswordPinDto::ForgotPasswordPinDto(const ForgotPasswordPinDto &other) :
m_pin(other.m_pin){}
void ForgotPasswordPinDto::replaceData(ForgotPasswordPinDto &other) {
m_pin = other.m_pin;
}
DeviceOptions DeviceOptions::fromJson(QJsonObject source) {
DeviceOptions instance;
ForgotPasswordPinDto ForgotPasswordPinDto::fromJson(QJsonObject source) {
ForgotPasswordPinDto instance;
instance.setFromJson(source);
return instance;
}
void DeviceOptions::setFromJson(QJsonObject source) {
m_customName = Jellyfin::Support::fromJsonValue<QString>(source["CustomName"]);
void ForgotPasswordPinDto::setFromJson(QJsonObject source) {
m_pin = Jellyfin::Support::fromJsonValue<QString>(source["Pin"]);
}
QJsonObject DeviceOptions::toJson() const {
QJsonObject ForgotPasswordPinDto::toJson() const {
QJsonObject result;
if (!(m_customName.isNull())) {
result["CustomName"] = Jellyfin::Support::toJsonValue<QString>(m_customName);
}
result["Pin"] = Jellyfin::Support::toJsonValue<QString>(m_pin);
return result;
}
QString DeviceOptions::customName() const { return m_customName; }
QString ForgotPasswordPinDto::pin() const { return m_pin; }
void DeviceOptions::setCustomName(QString newCustomName) {
m_customName = newCustomName;
}
bool DeviceOptions::customNameNull() const {
return m_customName.isNull();
void ForgotPasswordPinDto::setPin(QString newPin) {
m_pin = newPin;
}
void DeviceOptions::setCustomNameNull() {
m_customName.clear();
}
} // NS DTO
namespace Support {
using DeviceOptions = Jellyfin::DTO::DeviceOptions;
using ForgotPasswordPinDto = Jellyfin::DTO::ForgotPasswordPinDto;
template <>
DeviceOptions fromJsonValue(const QJsonValue &source, convertType<DeviceOptions>) {
ForgotPasswordPinDto fromJsonValue(const QJsonValue &source, convertType<ForgotPasswordPinDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return DeviceOptions::fromJson(source.toObject());
return ForgotPasswordPinDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const DeviceOptions &source, convertType<DeviceOptions>) {
QJsonValue toJsonValue(const ForgotPasswordPinDto &source, convertType<ForgotPasswordPinDto>) {
return source.toJson();
}

View file

@ -35,10 +35,12 @@ namespace DTO {
GeneralCommand::GeneralCommand() {}
GeneralCommand::GeneralCommand (
GeneralCommandType name,
QString controllingUserId
QString controllingUserId,
QJsonObject arguments
) :
m_name(name),
m_controllingUserId(controllingUserId) { }
m_controllingUserId(controllingUserId),
m_arguments(arguments) { }
@ -74,11 +76,7 @@ QJsonObject GeneralCommand::toJson() const {
result["Name"] = Jellyfin::Support::toJsonValue<GeneralCommandType>(m_name);
result["ControllingUserId"] = Jellyfin::Support::toJsonValue<QString>(m_controllingUserId);
if (!(m_arguments.isEmpty())) {
result["Arguments"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_arguments);
}
result["Arguments"] = Jellyfin::Support::toJsonValue<QJsonObject>(m_arguments);
return result;
}
@ -99,14 +97,7 @@ QJsonObject GeneralCommand::arguments() const { return m_arguments; }
void GeneralCommand::setArguments(QJsonObject newArguments) {
m_arguments = newArguments;
}
bool GeneralCommand::argumentsNull() const {
return m_arguments.isEmpty();
}
void GeneralCommand::setArgumentsNull() {
m_arguments= QJsonObject();
}
} // NS DTO

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/generalcommandmessage.h>
namespace Jellyfin {
namespace DTO {
GeneralCommandMessage::GeneralCommandMessage() {}
GeneralCommandMessage::GeneralCommandMessage (
QSharedPointer<GeneralCommand> data,
QString messageId,
SessionMessageType messageType
) :
m_data(data),
m_messageId(messageId),
m_messageType(messageType) { }
GeneralCommandMessage::GeneralCommandMessage(const GeneralCommandMessage &other) :
m_data(other.m_data),
m_messageId(other.m_messageId),
m_messageType(other.m_messageType){}
void GeneralCommandMessage::replaceData(GeneralCommandMessage &other) {
m_data = other.m_data;
m_messageId = other.m_messageId;
m_messageType = other.m_messageType;
}
GeneralCommandMessage GeneralCommandMessage::fromJson(QJsonObject source) {
GeneralCommandMessage instance;
instance.setFromJson(source);
return instance;
}
void GeneralCommandMessage::setFromJson(QJsonObject source) {
m_data = Jellyfin::Support::fromJsonValue<QSharedPointer<GeneralCommand>>(source["Data"]);
m_messageId = Jellyfin::Support::fromJsonValue<QString>(source["MessageId"]);
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject GeneralCommandMessage::toJson() const {
QJsonObject result;
result["Data"] = Jellyfin::Support::toJsonValue<QSharedPointer<GeneralCommand>>(m_data);
result["MessageId"] = Jellyfin::Support::toJsonValue<QString>(m_messageId);
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
QSharedPointer<GeneralCommand> GeneralCommandMessage::data() const { return m_data; }
void GeneralCommandMessage::setData(QSharedPointer<GeneralCommand> newData) {
m_data = newData;
}
QString GeneralCommandMessage::messageId() const { return m_messageId; }
void GeneralCommandMessage::setMessageId(QString newMessageId) {
m_messageId = newMessageId;
}
SessionMessageType GeneralCommandMessage::messageType() const { return m_messageType; }
void GeneralCommandMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using GeneralCommandMessage = Jellyfin::DTO::GeneralCommandMessage;
template <>
GeneralCommandMessage fromJsonValue(const QJsonValue &source, convertType<GeneralCommandMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return GeneralCommandMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const GeneralCommandMessage &source, convertType<GeneralCommandMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -168,6 +168,12 @@ GeneralCommandType fromJsonValue(const QJsonValue &source, convertType<GeneralCo
if (str == QStringLiteral("Play")) {
return GeneralCommandType::Play;
}
if (str == QStringLiteral("SetMaxStreamingBitrate")) {
return GeneralCommandType::SetMaxStreamingBitrate;
}
if (str == QStringLiteral("SetPlaybackOrder")) {
return GeneralCommandType::SetPlaybackOrder;
}
return GeneralCommandType::EnumNotSet;
}
@ -257,6 +263,10 @@ QJsonValue toJsonValue(const GeneralCommandType &source, convertType<GeneralComm
return QStringLiteral("ToggleOsdMenu");
case GeneralCommandType::Play:
return QStringLiteral("Play");
case GeneralCommandType::SetMaxStreamingBitrate:
return QStringLiteral("SetMaxStreamingBitrate");
case GeneralCommandType::SetPlaybackOrder:
return QStringLiteral("SetPlaybackOrder");
case GeneralCommandType::EnumNotSet: // Fallthrough
default:

View file

@ -34,13 +34,9 @@ namespace DTO {
GetProgramsDto::GetProgramsDto() {}
GetProgramsDto::GetProgramsDto (
QString userId,
bool enableTotalRecordCount,
QString librarySeriesId
std::optional<bool> enableTotalRecordCount
) :
m_userId(userId),
m_enableTotalRecordCount(enableTotalRecordCount),
m_librarySeriesId(librarySeriesId) { }
m_enableTotalRecordCount(enableTotalRecordCount) { }
@ -128,12 +124,12 @@ void GetProgramsDto::setFromJson(QJsonObject source) {
m_isSports = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsSports"]);
m_startIndex = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["StartIndex"]);
m_limit = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["Limit"]);
m_sortBy = Jellyfin::Support::fromJsonValue<QString>(source["SortBy"]);
m_sortOrder = Jellyfin::Support::fromJsonValue<QString>(source["SortOrder"]);
m_sortBy = Jellyfin::Support::fromJsonValue<QList<ItemSortBy>>(source["SortBy"]);
m_sortOrder = Jellyfin::Support::fromJsonValue<QList<SortOrder>>(source["SortOrder"]);
m_genres = Jellyfin::Support::fromJsonValue<QStringList>(source["Genres"]);
m_genreIds = Jellyfin::Support::fromJsonValue<QStringList>(source["GenreIds"]);
m_enableImages = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["EnableImages"]);
m_enableTotalRecordCount = Jellyfin::Support::fromJsonValue<bool>(source["EnableTotalRecordCount"]);
m_enableTotalRecordCount = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["EnableTotalRecordCount"]);
m_imageTypeLimit = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["ImageTypeLimit"]);
m_enableImageTypes = Jellyfin::Support::fromJsonValue<QList<ImageType>>(source["EnableImageTypes"]);
m_enableUserData = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["EnableUserData"]);
@ -151,7 +147,11 @@ QJsonObject GetProgramsDto::toJson() const {
result["ChannelIds"] = Jellyfin::Support::toJsonValue<QStringList>(m_channelIds);
}
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
if (!(m_userId.isNull())) {
result["UserId"] = Jellyfin::Support::toJsonValue<QString>(m_userId);
}
if (!(m_minStartDate.isNull())) {
result["MinStartDate"] = Jellyfin::Support::toJsonValue<QDateTime>(m_minStartDate);
@ -218,13 +218,13 @@ QJsonObject GetProgramsDto::toJson() const {
}
if (!(m_sortBy.isNull())) {
result["SortBy"] = Jellyfin::Support::toJsonValue<QString>(m_sortBy);
if (!(m_sortBy.size() == 0)) {
result["SortBy"] = Jellyfin::Support::toJsonValue<QList<ItemSortBy>>(m_sortBy);
}
if (!(m_sortOrder.isNull())) {
result["SortOrder"] = Jellyfin::Support::toJsonValue<QString>(m_sortOrder);
if (!(m_sortOrder.size() == 0)) {
result["SortOrder"] = Jellyfin::Support::toJsonValue<QList<SortOrder>>(m_sortOrder);
}
@ -242,7 +242,7 @@ QJsonObject GetProgramsDto::toJson() const {
result["EnableImages"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableImages);
}
result["EnableTotalRecordCount"] = Jellyfin::Support::toJsonValue<bool>(m_enableTotalRecordCount);
result["EnableTotalRecordCount"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_enableTotalRecordCount);
if (!(!m_imageTypeLimit.has_value())) {
result["ImageTypeLimit"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_imageTypeLimit);
@ -263,7 +263,11 @@ QJsonObject GetProgramsDto::toJson() const {
result["SeriesTimerId"] = Jellyfin::Support::toJsonValue<QString>(m_seriesTimerId);
}
result["LibrarySeriesId"] = Jellyfin::Support::toJsonValue<QString>(m_librarySeriesId);
if (!(m_librarySeriesId.isNull())) {
result["LibrarySeriesId"] = Jellyfin::Support::toJsonValue<QString>(m_librarySeriesId);
}
if (!(m_fields.size() == 0)) {
result["Fields"] = Jellyfin::Support::toJsonValue<QList<ItemFields>>(m_fields);
@ -290,7 +294,14 @@ QString GetProgramsDto::userId() const { return m_userId; }
void GetProgramsDto::setUserId(QString newUserId) {
m_userId = newUserId;
}
bool GetProgramsDto::userIdNull() const {
return m_userId.isNull();
}
void GetProgramsDto::setUserIdNull() {
m_userId.clear();
}
QDateTime GetProgramsDto::minStartDate() const { return m_minStartDate; }
void GetProgramsDto::setMinStartDate(QDateTime newMinStartDate) {
@ -460,26 +471,26 @@ void GetProgramsDto::setLimitNull() {
m_limit = std::nullopt;
}
QString GetProgramsDto::sortBy() const { return m_sortBy; }
QList<ItemSortBy> GetProgramsDto::sortBy() const { return m_sortBy; }
void GetProgramsDto::setSortBy(QString newSortBy) {
void GetProgramsDto::setSortBy(QList<ItemSortBy> newSortBy) {
m_sortBy = newSortBy;
}
bool GetProgramsDto::sortByNull() const {
return m_sortBy.isNull();
return m_sortBy.size() == 0;
}
void GetProgramsDto::setSortByNull() {
m_sortBy.clear();
}
QString GetProgramsDto::sortOrder() const { return m_sortOrder; }
QList<SortOrder> GetProgramsDto::sortOrder() const { return m_sortOrder; }
void GetProgramsDto::setSortOrder(QString newSortOrder) {
void GetProgramsDto::setSortOrder(QList<SortOrder> newSortOrder) {
m_sortOrder = newSortOrder;
}
bool GetProgramsDto::sortOrderNull() const {
return m_sortOrder.isNull();
return m_sortOrder.size() == 0;
}
void GetProgramsDto::setSortOrderNull() {
@ -525,9 +536,9 @@ void GetProgramsDto::setEnableImagesNull() {
m_enableImages = std::nullopt;
}
bool GetProgramsDto::enableTotalRecordCount() const { return m_enableTotalRecordCount; }
std::optional<bool> GetProgramsDto::enableTotalRecordCount() const { return m_enableTotalRecordCount; }
void GetProgramsDto::setEnableTotalRecordCount(bool newEnableTotalRecordCount) {
void GetProgramsDto::setEnableTotalRecordCount(std::optional<bool> newEnableTotalRecordCount) {
m_enableTotalRecordCount = newEnableTotalRecordCount;
}
@ -588,7 +599,14 @@ QString GetProgramsDto::librarySeriesId() const { return m_librarySeriesId; }
void GetProgramsDto::setLibrarySeriesId(QString newLibrarySeriesId) {
m_librarySeriesId = newLibrarySeriesId;
}
bool GetProgramsDto::librarySeriesIdNull() const {
return m_librarySeriesId.isNull();
}
void GetProgramsDto::setLibrarySeriesIdNull() {
m_librarySeriesId.clear();
}
QList<ItemFields> GetProgramsDto::fields() const { return m_fields; }
void GetProgramsDto::setFields(QList<ItemFields> newFields) {

View file

@ -35,11 +35,15 @@ namespace DTO {
GroupInfoDto::GroupInfoDto() {}
GroupInfoDto::GroupInfoDto (
QString groupId,
QString groupName,
GroupStateType state,
QStringList participants,
QDateTime lastUpdatedAt
) :
m_groupId(groupId),
m_groupName(groupName),
m_state(state),
m_participants(participants),
m_lastUpdatedAt(lastUpdatedAt) { }
@ -81,17 +85,9 @@ QJsonObject GroupInfoDto::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
if (!(m_groupName.isNull())) {
result["GroupName"] = Jellyfin::Support::toJsonValue<QString>(m_groupName);
}
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["Participants"] = Jellyfin::Support::toJsonValue<QStringList>(m_participants);
result["LastUpdatedAt"] = Jellyfin::Support::toJsonValue<QDateTime>(m_lastUpdatedAt);
return result;
}
@ -107,14 +103,7 @@ QString GroupInfoDto::groupName() const { return m_groupName; }
void GroupInfoDto::setGroupName(QString newGroupName) {
m_groupName = newGroupName;
}
bool GroupInfoDto::groupNameNull() const {
return m_groupName.isNull();
}
void GroupInfoDto::setGroupNameNull() {
m_groupName.clear();
}
GroupStateType GroupInfoDto::state() const { return m_state; }
void GroupInfoDto::setState(GroupStateType newState) {
@ -126,14 +115,7 @@ QStringList GroupInfoDto::participants() const { return m_participants; }
void GroupInfoDto::setParticipants(QStringList newParticipants) {
m_participants = newParticipants;
}
bool GroupInfoDto::participantsNull() const {
return m_participants.size() == 0;
}
void GroupInfoDto::setParticipantsNull() {
m_participants.clear();
}
QDateTime GroupInfoDto::lastUpdatedAt() const { return m_lastUpdatedAt; }
void GroupInfoDto::setLastUpdatedAt(QDateTime newLastUpdatedAt) {

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/groupinfodtogroupupdate.h>
namespace Jellyfin {
namespace DTO {
GroupInfoDtoGroupUpdate::GroupInfoDtoGroupUpdate() {}
GroupInfoDtoGroupUpdate::GroupInfoDtoGroupUpdate (
QString groupId,
GroupUpdateType type,
QSharedPointer<GroupInfoDto> data
) :
m_groupId(groupId),
m_type(type),
m_data(data) { }
GroupInfoDtoGroupUpdate::GroupInfoDtoGroupUpdate(const GroupInfoDtoGroupUpdate &other) :
m_groupId(other.m_groupId),
m_type(other.m_type),
m_data(other.m_data){}
void GroupInfoDtoGroupUpdate::replaceData(GroupInfoDtoGroupUpdate &other) {
m_groupId = other.m_groupId;
m_type = other.m_type;
m_data = other.m_data;
}
GroupInfoDtoGroupUpdate GroupInfoDtoGroupUpdate::fromJson(QJsonObject source) {
GroupInfoDtoGroupUpdate instance;
instance.setFromJson(source);
return instance;
}
void GroupInfoDtoGroupUpdate::setFromJson(QJsonObject source) {
m_groupId = Jellyfin::Support::fromJsonValue<QString>(source["GroupId"]);
m_type = Jellyfin::Support::fromJsonValue<GroupUpdateType>(source["Type"]);
m_data = Jellyfin::Support::fromJsonValue<QSharedPointer<GroupInfoDto>>(source["Data"]);
}
QJsonObject GroupInfoDtoGroupUpdate::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
result["Type"] = Jellyfin::Support::toJsonValue<GroupUpdateType>(m_type);
result["Data"] = Jellyfin::Support::toJsonValue<QSharedPointer<GroupInfoDto>>(m_data);
return result;
}
QString GroupInfoDtoGroupUpdate::groupId() const { return m_groupId; }
void GroupInfoDtoGroupUpdate::setGroupId(QString newGroupId) {
m_groupId = newGroupId;
}
GroupUpdateType GroupInfoDtoGroupUpdate::type() const { return m_type; }
void GroupInfoDtoGroupUpdate::setType(GroupUpdateType newType) {
m_type = newType;
}
QSharedPointer<GroupInfoDto> GroupInfoDtoGroupUpdate::data() const { return m_data; }
void GroupInfoDtoGroupUpdate::setData(QSharedPointer<GroupInfoDto> newData) {
m_data = newData;
}
} // NS DTO
namespace Support {
using GroupInfoDtoGroupUpdate = Jellyfin::DTO::GroupInfoDtoGroupUpdate;
template <>
GroupInfoDtoGroupUpdate fromJsonValue(const QJsonValue &source, convertType<GroupInfoDtoGroupUpdate>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return GroupInfoDtoGroupUpdate::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const GroupInfoDtoGroupUpdate &source, convertType<GroupInfoDtoGroupUpdate>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,108 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/groupstateupdate.h>
namespace Jellyfin {
namespace DTO {
GroupStateUpdate::GroupStateUpdate() {}
GroupStateUpdate::GroupStateUpdate (
GroupStateType state,
PlaybackRequestType reason
) :
m_state(state),
m_reason(reason) { }
GroupStateUpdate::GroupStateUpdate(const GroupStateUpdate &other) :
m_state(other.m_state),
m_reason(other.m_reason){}
void GroupStateUpdate::replaceData(GroupStateUpdate &other) {
m_state = other.m_state;
m_reason = other.m_reason;
}
GroupStateUpdate GroupStateUpdate::fromJson(QJsonObject source) {
GroupStateUpdate instance;
instance.setFromJson(source);
return instance;
}
void GroupStateUpdate::setFromJson(QJsonObject source) {
m_state = Jellyfin::Support::fromJsonValue<GroupStateType>(source["State"]);
m_reason = Jellyfin::Support::fromJsonValue<PlaybackRequestType>(source["Reason"]);
}
QJsonObject GroupStateUpdate::toJson() const {
QJsonObject result;
result["State"] = Jellyfin::Support::toJsonValue<GroupStateType>(m_state);
result["Reason"] = Jellyfin::Support::toJsonValue<PlaybackRequestType>(m_reason);
return result;
}
GroupStateType GroupStateUpdate::state() const { return m_state; }
void GroupStateUpdate::setState(GroupStateType newState) {
m_state = newState;
}
PlaybackRequestType GroupStateUpdate::reason() const { return m_reason; }
void GroupStateUpdate::setReason(PlaybackRequestType newReason) {
m_reason = newReason;
}
} // NS DTO
namespace Support {
using GroupStateUpdate = Jellyfin::DTO::GroupStateUpdate;
template <>
GroupStateUpdate fromJsonValue(const QJsonValue &source, convertType<GroupStateUpdate>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return GroupStateUpdate::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const GroupStateUpdate &source, convertType<GroupStateUpdate>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/groupstateupdategroupupdate.h>
namespace Jellyfin {
namespace DTO {
GroupStateUpdateGroupUpdate::GroupStateUpdateGroupUpdate() {}
GroupStateUpdateGroupUpdate::GroupStateUpdateGroupUpdate (
QString groupId,
GroupUpdateType type,
QSharedPointer<GroupStateUpdate> data
) :
m_groupId(groupId),
m_type(type),
m_data(data) { }
GroupStateUpdateGroupUpdate::GroupStateUpdateGroupUpdate(const GroupStateUpdateGroupUpdate &other) :
m_groupId(other.m_groupId),
m_type(other.m_type),
m_data(other.m_data){}
void GroupStateUpdateGroupUpdate::replaceData(GroupStateUpdateGroupUpdate &other) {
m_groupId = other.m_groupId;
m_type = other.m_type;
m_data = other.m_data;
}
GroupStateUpdateGroupUpdate GroupStateUpdateGroupUpdate::fromJson(QJsonObject source) {
GroupStateUpdateGroupUpdate instance;
instance.setFromJson(source);
return instance;
}
void GroupStateUpdateGroupUpdate::setFromJson(QJsonObject source) {
m_groupId = Jellyfin::Support::fromJsonValue<QString>(source["GroupId"]);
m_type = Jellyfin::Support::fromJsonValue<GroupUpdateType>(source["Type"]);
m_data = Jellyfin::Support::fromJsonValue<QSharedPointer<GroupStateUpdate>>(source["Data"]);
}
QJsonObject GroupStateUpdateGroupUpdate::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
result["Type"] = Jellyfin::Support::toJsonValue<GroupUpdateType>(m_type);
result["Data"] = Jellyfin::Support::toJsonValue<QSharedPointer<GroupStateUpdate>>(m_data);
return result;
}
QString GroupStateUpdateGroupUpdate::groupId() const { return m_groupId; }
void GroupStateUpdateGroupUpdate::setGroupId(QString newGroupId) {
m_groupId = newGroupId;
}
GroupUpdateType GroupStateUpdateGroupUpdate::type() const { return m_type; }
void GroupStateUpdateGroupUpdate::setType(GroupUpdateType newType) {
m_type = newType;
}
QSharedPointer<GroupStateUpdate> GroupStateUpdateGroupUpdate::data() const { return m_data; }
void GroupStateUpdateGroupUpdate::setData(QSharedPointer<GroupStateUpdate> newData) {
m_data = newData;
}
} // NS DTO
namespace Support {
using GroupStateUpdateGroupUpdate = Jellyfin::DTO::GroupStateUpdateGroupUpdate;
template <>
GroupStateUpdateGroupUpdate fromJsonValue(const QJsonValue &source, convertType<GroupStateUpdateGroupUpdate>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return GroupStateUpdateGroupUpdate::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const GroupStateUpdateGroupUpdate &source, convertType<GroupStateUpdateGroupUpdate>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,108 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/groupupdate.h>
namespace Jellyfin {
namespace DTO {
GroupUpdate::GroupUpdate() {}
GroupUpdate::GroupUpdate (
QString groupId,
GroupUpdateType type
) :
m_groupId(groupId),
m_type(type) { }
GroupUpdate::GroupUpdate(const GroupUpdate &other) :
m_groupId(other.m_groupId),
m_type(other.m_type){}
void GroupUpdate::replaceData(GroupUpdate &other) {
m_groupId = other.m_groupId;
m_type = other.m_type;
}
GroupUpdate GroupUpdate::fromJson(QJsonObject source) {
GroupUpdate instance;
instance.setFromJson(source);
return instance;
}
void GroupUpdate::setFromJson(QJsonObject source) {
m_groupId = Jellyfin::Support::fromJsonValue<QString>(source["GroupId"]);
m_type = Jellyfin::Support::fromJsonValue<GroupUpdateType>(source["Type"]);
}
QJsonObject GroupUpdate::toJson() const {
QJsonObject result;
result["GroupId"] = Jellyfin::Support::toJsonValue<QString>(m_groupId);
result["Type"] = Jellyfin::Support::toJsonValue<GroupUpdateType>(m_type);
return result;
}
QString GroupUpdate::groupId() const { return m_groupId; }
void GroupUpdate::setGroupId(QString newGroupId) {
m_groupId = newGroupId;
}
GroupUpdateType GroupUpdate::type() const { return m_type; }
void GroupUpdate::setType(GroupUpdateType newType) {
m_type = newType;
}
} // NS DTO
namespace Support {
using GroupUpdate = Jellyfin::DTO::GroupUpdate;
template <>
GroupUpdate fromJsonValue(const QJsonValue &source, convertType<GroupUpdate>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return GroupUpdate::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const GroupUpdate &source, convertType<GroupUpdate>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,103 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/hardwareaccelerationtype.h>
namespace Jellyfin {
namespace DTO {
HardwareAccelerationTypeClass::HardwareAccelerationTypeClass() {}
} // NS DTO
namespace Support {
using HardwareAccelerationType = Jellyfin::DTO::HardwareAccelerationType;
template <>
HardwareAccelerationType fromJsonValue(const QJsonValue &source, convertType<HardwareAccelerationType>) {
if (!source.isString()) return HardwareAccelerationType::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("none")) {
return HardwareAccelerationType::None;
}
if (str == QStringLiteral("amf")) {
return HardwareAccelerationType::Amf;
}
if (str == QStringLiteral("qsv")) {
return HardwareAccelerationType::Qsv;
}
if (str == QStringLiteral("nvenc")) {
return HardwareAccelerationType::Nvenc;
}
if (str == QStringLiteral("v4l2m2m")) {
return HardwareAccelerationType::V4l2m2m;
}
if (str == QStringLiteral("vaapi")) {
return HardwareAccelerationType::Vaapi;
}
if (str == QStringLiteral("videotoolbox")) {
return HardwareAccelerationType::Videotoolbox;
}
if (str == QStringLiteral("rkmpp")) {
return HardwareAccelerationType::Rkmpp;
}
return HardwareAccelerationType::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const HardwareAccelerationType &source, convertType<HardwareAccelerationType>) {
switch(source) {
case HardwareAccelerationType::None:
return QStringLiteral("none");
case HardwareAccelerationType::Amf:
return QStringLiteral("amf");
case HardwareAccelerationType::Qsv:
return QStringLiteral("qsv");
case HardwareAccelerationType::Nvenc:
return QStringLiteral("nvenc");
case HardwareAccelerationType::V4l2m2m:
return QStringLiteral("v4l2m2m");
case HardwareAccelerationType::Vaapi:
return QStringLiteral("vaapi");
case HardwareAccelerationType::Videotoolbox:
return QStringLiteral("videotoolbox");
case HardwareAccelerationType::Rkmpp:
return QStringLiteral("rkmpp");
case HardwareAccelerationType::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -1,138 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/httpheaderinfo.h>
namespace Jellyfin {
namespace DTO {
HttpHeaderInfo::HttpHeaderInfo() {}
HttpHeaderInfo::HttpHeaderInfo (
HeaderMatchType match
) :
m_match(match) { }
HttpHeaderInfo::HttpHeaderInfo(const HttpHeaderInfo &other) :
m_name(other.m_name),
m_value(other.m_value),
m_match(other.m_match){}
void HttpHeaderInfo::replaceData(HttpHeaderInfo &other) {
m_name = other.m_name;
m_value = other.m_value;
m_match = other.m_match;
}
HttpHeaderInfo HttpHeaderInfo::fromJson(QJsonObject source) {
HttpHeaderInfo instance;
instance.setFromJson(source);
return instance;
}
void HttpHeaderInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_value = Jellyfin::Support::fromJsonValue<QString>(source["Value"]);
m_match = Jellyfin::Support::fromJsonValue<HeaderMatchType>(source["Match"]);
}
QJsonObject HttpHeaderInfo::toJson() const {
QJsonObject result;
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;
}
QString HttpHeaderInfo::name() const { return m_name; }
void HttpHeaderInfo::setName(QString newName) {
m_name = newName;
}
bool HttpHeaderInfo::nameNull() const {
return m_name.isNull();
}
void HttpHeaderInfo::setNameNull() {
m_name.clear();
}
QString HttpHeaderInfo::value() const { return m_value; }
void HttpHeaderInfo::setValue(QString newValue) {
m_value = newValue;
}
bool HttpHeaderInfo::valueNull() const {
return m_value.isNull();
}
void HttpHeaderInfo::setValueNull() {
m_value.clear();
}
HeaderMatchType HttpHeaderInfo::match() const { return m_match; }
void HttpHeaderInfo::setMatch(HeaderMatchType newMatch) {
m_match = newMatch;
}
} // NS DTO
namespace Support {
using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo;
template <>
HttpHeaderInfo fromJsonValue(const QJsonValue &source, convertType<HttpHeaderInfo>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return HttpHeaderInfo::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const HttpHeaderInfo &source, convertType<HttpHeaderInfo>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -1,180 +0,0 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/imagebynameinfo.h>
namespace Jellyfin {
namespace DTO {
ImageByNameInfo::ImageByNameInfo() {}
ImageByNameInfo::ImageByNameInfo (
qint64 fileLength
) :
m_fileLength(fileLength) { }
ImageByNameInfo::ImageByNameInfo(const ImageByNameInfo &other) :
m_name(other.m_name),
m_theme(other.m_theme),
m_context(other.m_context),
m_fileLength(other.m_fileLength),
m_format(other.m_format){}
void ImageByNameInfo::replaceData(ImageByNameInfo &other) {
m_name = other.m_name;
m_theme = other.m_theme;
m_context = other.m_context;
m_fileLength = other.m_fileLength;
m_format = other.m_format;
}
ImageByNameInfo ImageByNameInfo::fromJson(QJsonObject source) {
ImageByNameInfo instance;
instance.setFromJson(source);
return instance;
}
void ImageByNameInfo::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_theme = Jellyfin::Support::fromJsonValue<QString>(source["Theme"]);
m_context = Jellyfin::Support::fromJsonValue<QString>(source["Context"]);
m_fileLength = Jellyfin::Support::fromJsonValue<qint64>(source["FileLength"]);
m_format = Jellyfin::Support::fromJsonValue<QString>(source["Format"]);
}
QJsonObject ImageByNameInfo::toJson() const {
QJsonObject result;
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);
if (!(m_format.isNull())) {
result["Format"] = Jellyfin::Support::toJsonValue<QString>(m_format);
}
return result;
}
QString ImageByNameInfo::name() const { return m_name; }
void ImageByNameInfo::setName(QString newName) {
m_name = newName;
}
bool ImageByNameInfo::nameNull() const {
return m_name.isNull();
}
void ImageByNameInfo::setNameNull() {
m_name.clear();
}
QString ImageByNameInfo::theme() const { return m_theme; }
void ImageByNameInfo::setTheme(QString newTheme) {
m_theme = newTheme;
}
bool ImageByNameInfo::themeNull() const {
return m_theme.isNull();
}
void ImageByNameInfo::setThemeNull() {
m_theme.clear();
}
QString ImageByNameInfo::context() const { return m_context; }
void ImageByNameInfo::setContext(QString newContext) {
m_context = newContext;
}
bool ImageByNameInfo::contextNull() const {
return m_context.isNull();
}
void ImageByNameInfo::setContextNull() {
m_context.clear();
}
qint64 ImageByNameInfo::fileLength() const { return m_fileLength; }
void ImageByNameInfo::setFileLength(qint64 newFileLength) {
m_fileLength = newFileLength;
}
QString ImageByNameInfo::format() const { return m_format; }
void ImageByNameInfo::setFormat(QString newFormat) {
m_format = newFormat;
}
bool ImageByNameInfo::formatNull() const {
return m_format.isNull();
}
void ImageByNameInfo::setFormatNull() {
m_format.clear();
}
} // NS DTO
namespace Support {
using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo;
template <>
ImageByNameInfo fromJsonValue(const QJsonValue &source, convertType<ImageByNameInfo>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return ImageByNameInfo::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const ImageByNameInfo &source, convertType<ImageByNameInfo>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -60,6 +60,9 @@ ImageFormat fromJsonValue(const QJsonValue &source, convertType<ImageFormat>) {
if (str == QStringLiteral("Webp")) {
return ImageFormat::Webp;
}
if (str == QStringLiteral("Svg")) {
return ImageFormat::Svg;
}
return ImageFormat::EnumNotSet;
}
@ -77,6 +80,8 @@ QJsonValue toJsonValue(const ImageFormat &source, convertType<ImageFormat>) {
return QStringLiteral("Png");
case ImageFormat::Webp:
return QStringLiteral("Webp");
case ImageFormat::Svg:
return QStringLiteral("Svg");
case ImageFormat::EnumNotSet: // Fallthrough
default:

View file

@ -33,6 +33,14 @@ namespace Jellyfin {
namespace DTO {
ImageProviderInfo::ImageProviderInfo() {}
ImageProviderInfo::ImageProviderInfo (
QString name,
QList<ImageType> supportedImages
) :
m_name(name),
m_supportedImages(supportedImages) { }
ImageProviderInfo::ImageProviderInfo(const ImageProviderInfo &other) :
@ -61,16 +69,8 @@ void ImageProviderInfo::setFromJson(QJsonObject source) {
QJsonObject ImageProviderInfo::toJson() const {
QJsonObject result;
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);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
result["SupportedImages"] = Jellyfin::Support::toJsonValue<QList<ImageType>>(m_supportedImages);
return result;
}
@ -79,27 +79,13 @@ QString ImageProviderInfo::name() const { return m_name; }
void ImageProviderInfo::setName(QString newName) {
m_name = newName;
}
bool ImageProviderInfo::nameNull() const {
return m_name.isNull();
}
void ImageProviderInfo::setNameNull() {
m_name.clear();
}
QList<ImageType> ImageProviderInfo::supportedImages() const { return m_supportedImages; }
void ImageProviderInfo::setSupportedImages(QList<ImageType> newSupportedImages) {
m_supportedImages = newSupportedImages;
}
bool ImageProviderInfo::supportedImagesNull() const {
return m_supportedImages.size() == 0;
}
void ImageProviderInfo::setSupportedImagesNull() {
m_supportedImages.clear();
}
} // NS DTO

View file

@ -0,0 +1,108 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/imageresolution.h>
namespace Jellyfin {
namespace DTO {
ImageResolutionClass::ImageResolutionClass() {}
} // NS DTO
namespace Support {
using ImageResolution = Jellyfin::DTO::ImageResolution;
template <>
ImageResolution fromJsonValue(const QJsonValue &source, convertType<ImageResolution>) {
if (!source.isString()) return ImageResolution::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("MatchSource")) {
return ImageResolution::MatchSource;
}
if (str == QStringLiteral("P144")) {
return ImageResolution::P144;
}
if (str == QStringLiteral("P240")) {
return ImageResolution::P240;
}
if (str == QStringLiteral("P360")) {
return ImageResolution::P360;
}
if (str == QStringLiteral("P480")) {
return ImageResolution::P480;
}
if (str == QStringLiteral("P720")) {
return ImageResolution::P720;
}
if (str == QStringLiteral("P1080")) {
return ImageResolution::P1080;
}
if (str == QStringLiteral("P1440")) {
return ImageResolution::P1440;
}
if (str == QStringLiteral("P2160")) {
return ImageResolution::P2160;
}
return ImageResolution::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const ImageResolution &source, convertType<ImageResolution>) {
switch(source) {
case ImageResolution::MatchSource:
return QStringLiteral("MatchSource");
case ImageResolution::P144:
return QStringLiteral("P144");
case ImageResolution::P240:
return QStringLiteral("P240");
case ImageResolution::P360:
return QStringLiteral("P360");
case ImageResolution::P480:
return QStringLiteral("P480");
case ImageResolution::P720:
return QStringLiteral("P720");
case ImageResolution::P1080:
return QStringLiteral("P1080");
case ImageResolution::P1440:
return QStringLiteral("P1440");
case ImageResolution::P2160:
return QStringLiteral("P2160");
case ImageResolution::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,96 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/inboundkeepalivemessage.h>
namespace Jellyfin {
namespace DTO {
InboundKeepAliveMessage::InboundKeepAliveMessage() {}
InboundKeepAliveMessage::InboundKeepAliveMessage (
SessionMessageType messageType
) :
m_messageType(messageType) { }
InboundKeepAliveMessage::InboundKeepAliveMessage(const InboundKeepAliveMessage &other) :
m_messageType(other.m_messageType){}
void InboundKeepAliveMessage::replaceData(InboundKeepAliveMessage &other) {
m_messageType = other.m_messageType;
}
InboundKeepAliveMessage InboundKeepAliveMessage::fromJson(QJsonObject source) {
InboundKeepAliveMessage instance;
instance.setFromJson(source);
return instance;
}
void InboundKeepAliveMessage::setFromJson(QJsonObject source) {
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject InboundKeepAliveMessage::toJson() const {
QJsonObject result;
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
SessionMessageType InboundKeepAliveMessage::messageType() const { return m_messageType; }
void InboundKeepAliveMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using InboundKeepAliveMessage = Jellyfin::DTO::InboundKeepAliveMessage;
template <>
InboundKeepAliveMessage fromJsonValue(const QJsonValue &source, convertType<InboundKeepAliveMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return InboundKeepAliveMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const InboundKeepAliveMessage &source, convertType<InboundKeepAliveMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -27,15 +27,11 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/loader/http/dlnaserver.h>
#include <JellyfinQt/dto/inboundwebsocketmessage.h>
namespace Jellyfin {
namespace Loader {
namespace HTTP {
using namespace Jellyfin::DTO;
namespace DTO {
} // NS HTTP
} // NS Loader
} // NS DTO
} // NS Jellyfin

View file

@ -35,10 +35,10 @@ namespace DTO {
InstallationInfo::InstallationInfo() {}
InstallationInfo::InstallationInfo (
QString guid,
QSharedPointer<Version> version
QSharedPointer<PackageInfo> packageInfo
) :
m_guid(guid),
m_version(version) { }
m_packageInfo(packageInfo) { }
@ -49,7 +49,8 @@ InstallationInfo::InstallationInfo(const InstallationInfo &other) :
m_version(other.m_version),
m_changelog(other.m_changelog),
m_sourceUrl(other.m_sourceUrl),
m_checksum(other.m_checksum){}
m_checksum(other.m_checksum),
m_packageInfo(other.m_packageInfo){}
void InstallationInfo::replaceData(InstallationInfo &other) {
@ -59,6 +60,7 @@ void InstallationInfo::replaceData(InstallationInfo &other) {
m_changelog = other.m_changelog;
m_sourceUrl = other.m_sourceUrl;
m_checksum = other.m_checksum;
m_packageInfo = other.m_packageInfo;
}
InstallationInfo InstallationInfo::fromJson(QJsonObject source) {
@ -71,10 +73,11 @@ InstallationInfo InstallationInfo::fromJson(QJsonObject source) {
void InstallationInfo::setFromJson(QJsonObject source) {
m_guid = Jellyfin::Support::fromJsonValue<QString>(source["Guid"]);
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_version = Jellyfin::Support::fromJsonValue<QSharedPointer<Version>>(source["Version"]);
m_version = Jellyfin::Support::fromJsonValue<QString>(source["Version"]);
m_changelog = Jellyfin::Support::fromJsonValue<QString>(source["Changelog"]);
m_sourceUrl = Jellyfin::Support::fromJsonValue<QString>(source["SourceUrl"]);
m_checksum = Jellyfin::Support::fromJsonValue<QString>(source["Checksum"]);
m_packageInfo = Jellyfin::Support::fromJsonValue<QSharedPointer<PackageInfo>>(source["PackageInfo"]);
}
@ -87,7 +90,11 @@ QJsonObject InstallationInfo::toJson() const {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Version"] = Jellyfin::Support::toJsonValue<QSharedPointer<Version>>(m_version);
if (!(m_version.isNull())) {
result["Version"] = Jellyfin::Support::toJsonValue<QString>(m_version);
}
if (!(m_changelog.isNull())) {
result["Changelog"] = Jellyfin::Support::toJsonValue<QString>(m_changelog);
@ -102,7 +109,8 @@ QJsonObject InstallationInfo::toJson() const {
if (!(m_checksum.isNull())) {
result["Checksum"] = Jellyfin::Support::toJsonValue<QString>(m_checksum);
}
result["PackageInfo"] = Jellyfin::Support::toJsonValue<QSharedPointer<PackageInfo>>(m_packageInfo);
return result;
}
@ -125,12 +133,19 @@ void InstallationInfo::setNameNull() {
m_name.clear();
}
QSharedPointer<Version> InstallationInfo::version() const { return m_version; }
QString InstallationInfo::version() const { return m_version; }
void InstallationInfo::setVersion(QSharedPointer<Version> newVersion) {
void InstallationInfo::setVersion(QString newVersion) {
m_version = newVersion;
}
bool InstallationInfo::versionNull() const {
return m_version.isNull();
}
void InstallationInfo::setVersionNull() {
m_version.clear();
}
QString InstallationInfo::changelog() const { return m_changelog; }
void InstallationInfo::setChangelog(QString newChangelog) {
@ -170,6 +185,12 @@ void InstallationInfo::setChecksumNull() {
m_checksum.clear();
}
QSharedPointer<PackageInfo> InstallationInfo::packageInfo() const { return m_packageInfo; }
void InstallationInfo::setPackageInfo(QSharedPointer<PackageInfo> newPackageInfo) {
m_packageInfo = newPackageInfo;
}
} // NS DTO

View file

@ -35,11 +35,9 @@ namespace DTO {
IPlugin::IPlugin() {}
IPlugin::IPlugin (
QString jellyfinId,
QSharedPointer<Version> version,
bool canUninstall
) :
m_jellyfinId(jellyfinId),
m_version(version),
m_canUninstall(canUninstall) { }
@ -76,7 +74,7 @@ void IPlugin::setFromJson(QJsonObject source) {
m_name = Jellyfin::Support::fromJsonValue<QString>(source["Name"]);
m_description = Jellyfin::Support::fromJsonValue<QString>(source["Description"]);
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_version = Jellyfin::Support::fromJsonValue<QSharedPointer<Version>>(source["Version"]);
m_version = Jellyfin::Support::fromJsonValue<QString>(source["Version"]);
m_assemblyFilePath = Jellyfin::Support::fromJsonValue<QString>(source["AssemblyFilePath"]);
m_canUninstall = Jellyfin::Support::fromJsonValue<bool>(source["CanUninstall"]);
m_dataFolderPath = Jellyfin::Support::fromJsonValue<QString>(source["DataFolderPath"]);
@ -97,7 +95,11 @@ QJsonObject IPlugin::toJson() const {
}
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["Version"] = Jellyfin::Support::toJsonValue<QSharedPointer<Version>>(m_version);
if (!(m_version.isNull())) {
result["Version"] = Jellyfin::Support::toJsonValue<QString>(m_version);
}
if (!(m_assemblyFilePath.isNull())) {
result["AssemblyFilePath"] = Jellyfin::Support::toJsonValue<QString>(m_assemblyFilePath);
@ -144,12 +146,19 @@ void IPlugin::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
QSharedPointer<Version> IPlugin::version() const { return m_version; }
QString IPlugin::version() const { return m_version; }
void IPlugin::setVersion(QSharedPointer<Version> newVersion) {
void IPlugin::setVersion(QString newVersion) {
m_version = newVersion;
}
bool IPlugin::versionNull() const {
return m_version.isNull();
}
void IPlugin::setVersionNull() {
m_version.clear();
}
QString IPlugin::assemblyFilePath() const { return m_assemblyFilePath; }
void IPlugin::setAssemblyFilePath(QString newAssemblyFilePath) {

View file

@ -60,6 +60,9 @@ ItemFields fromJsonValue(const QJsonValue &source, convertType<ItemFields>) {
if (str == QStringLiteral("Chapters")) {
return ItemFields::Chapters;
}
if (str == QStringLiteral("Trickplay")) {
return ItemFields::Trickplay;
}
if (str == QStringLiteral("ChildCount")) {
return ItemFields::ChildCount;
}
@ -150,12 +153,6 @@ ItemFields fromJsonValue(const QJsonValue &source, convertType<ItemFields>) {
if (str == QStringLiteral("Studios")) {
return ItemFields::Studios;
}
if (str == QStringLiteral("BasicSyncInfo")) {
return ItemFields::BasicSyncInfo;
}
if (str == QStringLiteral("SyncInfo")) {
return ItemFields::SyncInfo;
}
if (str == QStringLiteral("Taglines")) {
return ItemFields::Taglines;
}
@ -245,6 +242,8 @@ QJsonValue toJsonValue(const ItemFields &source, convertType<ItemFields>) {
return QStringLiteral("ChannelInfo");
case ItemFields::Chapters:
return QStringLiteral("Chapters");
case ItemFields::Trickplay:
return QStringLiteral("Trickplay");
case ItemFields::ChildCount:
return QStringLiteral("ChildCount");
case ItemFields::CumulativeRunTimeTicks:
@ -305,10 +304,6 @@ QJsonValue toJsonValue(const ItemFields &source, convertType<ItemFields>) {
return QStringLiteral("SpecialEpisodeNumbers");
case ItemFields::Studios:
return QStringLiteral("Studios");
case ItemFields::BasicSyncInfo:
return QStringLiteral("BasicSyncInfo");
case ItemFields::SyncInfo:
return QStringLiteral("SyncInfo");
case ItemFields::Taglines:
return QStringLiteral("Taglines");
case ItemFields::Tags:

223
core/src/dto/itemsortby.cpp Normal file
View file

@ -0,0 +1,223 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/itemsortby.h>
namespace Jellyfin {
namespace DTO {
ItemSortByClass::ItemSortByClass() {}
} // NS DTO
namespace Support {
using ItemSortBy = Jellyfin::DTO::ItemSortBy;
template <>
ItemSortBy fromJsonValue(const QJsonValue &source, convertType<ItemSortBy>) {
if (!source.isString()) return ItemSortBy::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Default")) {
return ItemSortBy::Default;
}
if (str == QStringLiteral("AiredEpisodeOrder")) {
return ItemSortBy::AiredEpisodeOrder;
}
if (str == QStringLiteral("Album")) {
return ItemSortBy::Album;
}
if (str == QStringLiteral("AlbumArtist")) {
return ItemSortBy::AlbumArtist;
}
if (str == QStringLiteral("Artist")) {
return ItemSortBy::Artist;
}
if (str == QStringLiteral("DateCreated")) {
return ItemSortBy::DateCreated;
}
if (str == QStringLiteral("OfficialRating")) {
return ItemSortBy::OfficialRating;
}
if (str == QStringLiteral("DatePlayed")) {
return ItemSortBy::DatePlayed;
}
if (str == QStringLiteral("PremiereDate")) {
return ItemSortBy::PremiereDate;
}
if (str == QStringLiteral("StartDate")) {
return ItemSortBy::StartDate;
}
if (str == QStringLiteral("SortName")) {
return ItemSortBy::SortName;
}
if (str == QStringLiteral("Name")) {
return ItemSortBy::Name;
}
if (str == QStringLiteral("Random")) {
return ItemSortBy::Random;
}
if (str == QStringLiteral("Runtime")) {
return ItemSortBy::Runtime;
}
if (str == QStringLiteral("CommunityRating")) {
return ItemSortBy::CommunityRating;
}
if (str == QStringLiteral("ProductionYear")) {
return ItemSortBy::ProductionYear;
}
if (str == QStringLiteral("PlayCount")) {
return ItemSortBy::PlayCount;
}
if (str == QStringLiteral("CriticRating")) {
return ItemSortBy::CriticRating;
}
if (str == QStringLiteral("IsFolder")) {
return ItemSortBy::IsFolder;
}
if (str == QStringLiteral("IsUnplayed")) {
return ItemSortBy::IsUnplayed;
}
if (str == QStringLiteral("IsPlayed")) {
return ItemSortBy::IsPlayed;
}
if (str == QStringLiteral("SeriesSortName")) {
return ItemSortBy::SeriesSortName;
}
if (str == QStringLiteral("VideoBitRate")) {
return ItemSortBy::VideoBitRate;
}
if (str == QStringLiteral("AirTime")) {
return ItemSortBy::AirTime;
}
if (str == QStringLiteral("Studio")) {
return ItemSortBy::Studio;
}
if (str == QStringLiteral("IsFavoriteOrLiked")) {
return ItemSortBy::IsFavoriteOrLiked;
}
if (str == QStringLiteral("DateLastContentAdded")) {
return ItemSortBy::DateLastContentAdded;
}
if (str == QStringLiteral("SeriesDatePlayed")) {
return ItemSortBy::SeriesDatePlayed;
}
if (str == QStringLiteral("ParentIndexNumber")) {
return ItemSortBy::ParentIndexNumber;
}
if (str == QStringLiteral("IndexNumber")) {
return ItemSortBy::IndexNumber;
}
if (str == QStringLiteral("SimilarityScore")) {
return ItemSortBy::SimilarityScore;
}
if (str == QStringLiteral("SearchScore")) {
return ItemSortBy::SearchScore;
}
return ItemSortBy::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const ItemSortBy &source, convertType<ItemSortBy>) {
switch(source) {
case ItemSortBy::Default:
return QStringLiteral("Default");
case ItemSortBy::AiredEpisodeOrder:
return QStringLiteral("AiredEpisodeOrder");
case ItemSortBy::Album:
return QStringLiteral("Album");
case ItemSortBy::AlbumArtist:
return QStringLiteral("AlbumArtist");
case ItemSortBy::Artist:
return QStringLiteral("Artist");
case ItemSortBy::DateCreated:
return QStringLiteral("DateCreated");
case ItemSortBy::OfficialRating:
return QStringLiteral("OfficialRating");
case ItemSortBy::DatePlayed:
return QStringLiteral("DatePlayed");
case ItemSortBy::PremiereDate:
return QStringLiteral("PremiereDate");
case ItemSortBy::StartDate:
return QStringLiteral("StartDate");
case ItemSortBy::SortName:
return QStringLiteral("SortName");
case ItemSortBy::Name:
return QStringLiteral("Name");
case ItemSortBy::Random:
return QStringLiteral("Random");
case ItemSortBy::Runtime:
return QStringLiteral("Runtime");
case ItemSortBy::CommunityRating:
return QStringLiteral("CommunityRating");
case ItemSortBy::ProductionYear:
return QStringLiteral("ProductionYear");
case ItemSortBy::PlayCount:
return QStringLiteral("PlayCount");
case ItemSortBy::CriticRating:
return QStringLiteral("CriticRating");
case ItemSortBy::IsFolder:
return QStringLiteral("IsFolder");
case ItemSortBy::IsUnplayed:
return QStringLiteral("IsUnplayed");
case ItemSortBy::IsPlayed:
return QStringLiteral("IsPlayed");
case ItemSortBy::SeriesSortName:
return QStringLiteral("SeriesSortName");
case ItemSortBy::VideoBitRate:
return QStringLiteral("VideoBitRate");
case ItemSortBy::AirTime:
return QStringLiteral("AirTime");
case ItemSortBy::Studio:
return QStringLiteral("Studio");
case ItemSortBy::IsFavoriteOrLiked:
return QStringLiteral("IsFavoriteOrLiked");
case ItemSortBy::DateLastContentAdded:
return QStringLiteral("DateLastContentAdded");
case ItemSortBy::SeriesDatePlayed:
return QStringLiteral("SeriesDatePlayed");
case ItemSortBy::ParentIndexNumber:
return QStringLiteral("ParentIndexNumber");
case ItemSortBy::IndexNumber:
return QStringLiteral("IndexNumber");
case ItemSortBy::SimilarityScore:
return QStringLiteral("SimilarityScore");
case ItemSortBy::SearchScore:
return QStringLiteral("SearchScore");
case ItemSortBy::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/librarychangedmessage.h>
namespace Jellyfin {
namespace DTO {
LibraryChangedMessage::LibraryChangedMessage() {}
LibraryChangedMessage::LibraryChangedMessage (
QSharedPointer<LibraryUpdateInfo> data,
QString messageId,
SessionMessageType messageType
) :
m_data(data),
m_messageId(messageId),
m_messageType(messageType) { }
LibraryChangedMessage::LibraryChangedMessage(const LibraryChangedMessage &other) :
m_data(other.m_data),
m_messageId(other.m_messageId),
m_messageType(other.m_messageType){}
void LibraryChangedMessage::replaceData(LibraryChangedMessage &other) {
m_data = other.m_data;
m_messageId = other.m_messageId;
m_messageType = other.m_messageType;
}
LibraryChangedMessage LibraryChangedMessage::fromJson(QJsonObject source) {
LibraryChangedMessage instance;
instance.setFromJson(source);
return instance;
}
void LibraryChangedMessage::setFromJson(QJsonObject source) {
m_data = Jellyfin::Support::fromJsonValue<QSharedPointer<LibraryUpdateInfo>>(source["Data"]);
m_messageId = Jellyfin::Support::fromJsonValue<QString>(source["MessageId"]);
m_messageType = Jellyfin::Support::fromJsonValue<SessionMessageType>(source["MessageType"]);
}
QJsonObject LibraryChangedMessage::toJson() const {
QJsonObject result;
result["Data"] = Jellyfin::Support::toJsonValue<QSharedPointer<LibraryUpdateInfo>>(m_data);
result["MessageId"] = Jellyfin::Support::toJsonValue<QString>(m_messageId);
result["MessageType"] = Jellyfin::Support::toJsonValue<SessionMessageType>(m_messageType);
return result;
}
QSharedPointer<LibraryUpdateInfo> LibraryChangedMessage::data() const { return m_data; }
void LibraryChangedMessage::setData(QSharedPointer<LibraryUpdateInfo> newData) {
m_data = newData;
}
QString LibraryChangedMessage::messageId() const { return m_messageId; }
void LibraryChangedMessage::setMessageId(QString newMessageId) {
m_messageId = newMessageId;
}
SessionMessageType LibraryChangedMessage::messageType() const { return m_messageType; }
void LibraryChangedMessage::setMessageType(SessionMessageType newMessageType) {
m_messageType = newMessageType;
}
} // NS DTO
namespace Support {
using LibraryChangedMessage = Jellyfin::DTO::LibraryChangedMessage;
template <>
LibraryChangedMessage fromJsonValue(const QJsonValue &source, convertType<LibraryChangedMessage>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return LibraryChangedMessage::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const LibraryChangedMessage &source, convertType<LibraryChangedMessage>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -34,49 +34,100 @@ namespace DTO {
LibraryOptions::LibraryOptions() {}
LibraryOptions::LibraryOptions (
bool enabled,
bool enablePhotos,
bool enableRealtimeMonitor,
bool enableLUFSScan,
bool enableChapterImageExtraction,
bool extractChapterImagesDuringLibraryScan,
bool enableTrickplayImageExtraction,
bool extractTrickplayImagesDuringLibraryScan,
QList<MediaPathInfo> pathInfos,
bool saveLocalMetadata,
bool enableInternetProviders,
bool enableAutomaticSeriesGrouping,
bool enableEmbeddedTitles,
bool enableEmbeddedExtrasTitles,
bool enableEmbeddedEpisodeInfos,
qint32 automaticRefreshIntervalDays,
QString seasonZeroDisplayName,
QStringList disabledLocalMetadataReaders,
QStringList disabledSubtitleFetchers,
QStringList subtitleFetcherOrder,
QStringList disabledMediaSegmentProviders,
QStringList mediaSegmentProvideOrder,
bool skipSubtitlesIfEmbeddedSubtitlesPresent,
bool skipSubtitlesIfAudioTrackMatches,
bool requirePerfectSubtitleMatch,
bool saveSubtitlesWithMedia
bool saveSubtitlesWithMedia,
std::optional<bool> saveLyricsWithMedia,
std::optional<bool> saveTrickplayWithMedia,
QStringList disabledLyricFetchers,
QStringList lyricFetcherOrder,
std::optional<bool> preferNonstandardArtistsTag,
std::optional<bool> useCustomTagDelimiters,
QStringList customTagDelimiters,
QStringList delimiterWhitelist,
bool automaticallyAddToCollection,
EmbeddedSubtitleOptions allowEmbeddedSubtitles,
QList<TypeOptions> typeOptions
) :
m_enabled(enabled),
m_enablePhotos(enablePhotos),
m_enableRealtimeMonitor(enableRealtimeMonitor),
m_enableLUFSScan(enableLUFSScan),
m_enableChapterImageExtraction(enableChapterImageExtraction),
m_extractChapterImagesDuringLibraryScan(extractChapterImagesDuringLibraryScan),
m_enableTrickplayImageExtraction(enableTrickplayImageExtraction),
m_extractTrickplayImagesDuringLibraryScan(extractTrickplayImagesDuringLibraryScan),
m_pathInfos(pathInfos),
m_saveLocalMetadata(saveLocalMetadata),
m_enableInternetProviders(enableInternetProviders),
m_enableAutomaticSeriesGrouping(enableAutomaticSeriesGrouping),
m_enableEmbeddedTitles(enableEmbeddedTitles),
m_enableEmbeddedExtrasTitles(enableEmbeddedExtrasTitles),
m_enableEmbeddedEpisodeInfos(enableEmbeddedEpisodeInfos),
m_automaticRefreshIntervalDays(automaticRefreshIntervalDays),
m_seasonZeroDisplayName(seasonZeroDisplayName),
m_disabledLocalMetadataReaders(disabledLocalMetadataReaders),
m_disabledSubtitleFetchers(disabledSubtitleFetchers),
m_subtitleFetcherOrder(subtitleFetcherOrder),
m_disabledMediaSegmentProviders(disabledMediaSegmentProviders),
m_mediaSegmentProvideOrder(mediaSegmentProvideOrder),
m_skipSubtitlesIfEmbeddedSubtitlesPresent(skipSubtitlesIfEmbeddedSubtitlesPresent),
m_skipSubtitlesIfAudioTrackMatches(skipSubtitlesIfAudioTrackMatches),
m_requirePerfectSubtitleMatch(requirePerfectSubtitleMatch),
m_saveSubtitlesWithMedia(saveSubtitlesWithMedia) { }
m_saveSubtitlesWithMedia(saveSubtitlesWithMedia),
m_saveLyricsWithMedia(saveLyricsWithMedia),
m_saveTrickplayWithMedia(saveTrickplayWithMedia),
m_disabledLyricFetchers(disabledLyricFetchers),
m_lyricFetcherOrder(lyricFetcherOrder),
m_preferNonstandardArtistsTag(preferNonstandardArtistsTag),
m_useCustomTagDelimiters(useCustomTagDelimiters),
m_customTagDelimiters(customTagDelimiters),
m_delimiterWhitelist(delimiterWhitelist),
m_automaticallyAddToCollection(automaticallyAddToCollection),
m_allowEmbeddedSubtitles(allowEmbeddedSubtitles),
m_typeOptions(typeOptions) { }
LibraryOptions::LibraryOptions(const LibraryOptions &other) :
m_enabled(other.m_enabled),
m_enablePhotos(other.m_enablePhotos),
m_enableRealtimeMonitor(other.m_enableRealtimeMonitor),
m_enableLUFSScan(other.m_enableLUFSScan),
m_enableChapterImageExtraction(other.m_enableChapterImageExtraction),
m_extractChapterImagesDuringLibraryScan(other.m_extractChapterImagesDuringLibraryScan),
m_enableTrickplayImageExtraction(other.m_enableTrickplayImageExtraction),
m_extractTrickplayImagesDuringLibraryScan(other.m_extractTrickplayImagesDuringLibraryScan),
m_pathInfos(other.m_pathInfos),
m_saveLocalMetadata(other.m_saveLocalMetadata),
m_enableInternetProviders(other.m_enableInternetProviders),
m_enableAutomaticSeriesGrouping(other.m_enableAutomaticSeriesGrouping),
m_enableEmbeddedTitles(other.m_enableEmbeddedTitles),
m_enableEmbeddedExtrasTitles(other.m_enableEmbeddedExtrasTitles),
m_enableEmbeddedEpisodeInfos(other.m_enableEmbeddedEpisodeInfos),
m_automaticRefreshIntervalDays(other.m_automaticRefreshIntervalDays),
m_preferredMetadataLanguage(other.m_preferredMetadataLanguage),
@ -87,24 +138,41 @@ LibraryOptions::LibraryOptions(const LibraryOptions &other) :
m_localMetadataReaderOrder(other.m_localMetadataReaderOrder),
m_disabledSubtitleFetchers(other.m_disabledSubtitleFetchers),
m_subtitleFetcherOrder(other.m_subtitleFetcherOrder),
m_disabledMediaSegmentProviders(other.m_disabledMediaSegmentProviders),
m_mediaSegmentProvideOrder(other.m_mediaSegmentProvideOrder),
m_skipSubtitlesIfEmbeddedSubtitlesPresent(other.m_skipSubtitlesIfEmbeddedSubtitlesPresent),
m_skipSubtitlesIfAudioTrackMatches(other.m_skipSubtitlesIfAudioTrackMatches),
m_subtitleDownloadLanguages(other.m_subtitleDownloadLanguages),
m_requirePerfectSubtitleMatch(other.m_requirePerfectSubtitleMatch),
m_saveSubtitlesWithMedia(other.m_saveSubtitlesWithMedia),
m_saveLyricsWithMedia(other.m_saveLyricsWithMedia),
m_saveTrickplayWithMedia(other.m_saveTrickplayWithMedia),
m_disabledLyricFetchers(other.m_disabledLyricFetchers),
m_lyricFetcherOrder(other.m_lyricFetcherOrder),
m_preferNonstandardArtistsTag(other.m_preferNonstandardArtistsTag),
m_useCustomTagDelimiters(other.m_useCustomTagDelimiters),
m_customTagDelimiters(other.m_customTagDelimiters),
m_delimiterWhitelist(other.m_delimiterWhitelist),
m_automaticallyAddToCollection(other.m_automaticallyAddToCollection),
m_allowEmbeddedSubtitles(other.m_allowEmbeddedSubtitles),
m_typeOptions(other.m_typeOptions){}
void LibraryOptions::replaceData(LibraryOptions &other) {
m_enabled = other.m_enabled;
m_enablePhotos = other.m_enablePhotos;
m_enableRealtimeMonitor = other.m_enableRealtimeMonitor;
m_enableLUFSScan = other.m_enableLUFSScan;
m_enableChapterImageExtraction = other.m_enableChapterImageExtraction;
m_extractChapterImagesDuringLibraryScan = other.m_extractChapterImagesDuringLibraryScan;
m_enableTrickplayImageExtraction = other.m_enableTrickplayImageExtraction;
m_extractTrickplayImagesDuringLibraryScan = other.m_extractTrickplayImagesDuringLibraryScan;
m_pathInfos = other.m_pathInfos;
m_saveLocalMetadata = other.m_saveLocalMetadata;
m_enableInternetProviders = other.m_enableInternetProviders;
m_enableAutomaticSeriesGrouping = other.m_enableAutomaticSeriesGrouping;
m_enableEmbeddedTitles = other.m_enableEmbeddedTitles;
m_enableEmbeddedExtrasTitles = other.m_enableEmbeddedExtrasTitles;
m_enableEmbeddedEpisodeInfos = other.m_enableEmbeddedEpisodeInfos;
m_automaticRefreshIntervalDays = other.m_automaticRefreshIntervalDays;
m_preferredMetadataLanguage = other.m_preferredMetadataLanguage;
@ -115,11 +183,23 @@ void LibraryOptions::replaceData(LibraryOptions &other) {
m_localMetadataReaderOrder = other.m_localMetadataReaderOrder;
m_disabledSubtitleFetchers = other.m_disabledSubtitleFetchers;
m_subtitleFetcherOrder = other.m_subtitleFetcherOrder;
m_disabledMediaSegmentProviders = other.m_disabledMediaSegmentProviders;
m_mediaSegmentProvideOrder = other.m_mediaSegmentProvideOrder;
m_skipSubtitlesIfEmbeddedSubtitlesPresent = other.m_skipSubtitlesIfEmbeddedSubtitlesPresent;
m_skipSubtitlesIfAudioTrackMatches = other.m_skipSubtitlesIfAudioTrackMatches;
m_subtitleDownloadLanguages = other.m_subtitleDownloadLanguages;
m_requirePerfectSubtitleMatch = other.m_requirePerfectSubtitleMatch;
m_saveSubtitlesWithMedia = other.m_saveSubtitlesWithMedia;
m_saveLyricsWithMedia = other.m_saveLyricsWithMedia;
m_saveTrickplayWithMedia = other.m_saveTrickplayWithMedia;
m_disabledLyricFetchers = other.m_disabledLyricFetchers;
m_lyricFetcherOrder = other.m_lyricFetcherOrder;
m_preferNonstandardArtistsTag = other.m_preferNonstandardArtistsTag;
m_useCustomTagDelimiters = other.m_useCustomTagDelimiters;
m_customTagDelimiters = other.m_customTagDelimiters;
m_delimiterWhitelist = other.m_delimiterWhitelist;
m_automaticallyAddToCollection = other.m_automaticallyAddToCollection;
m_allowEmbeddedSubtitles = other.m_allowEmbeddedSubtitles;
m_typeOptions = other.m_typeOptions;
}
@ -131,15 +211,20 @@ LibraryOptions LibraryOptions::fromJson(QJsonObject source) {
void LibraryOptions::setFromJson(QJsonObject source) {
m_enabled = Jellyfin::Support::fromJsonValue<bool>(source["Enabled"]);
m_enablePhotos = Jellyfin::Support::fromJsonValue<bool>(source["EnablePhotos"]);
m_enableRealtimeMonitor = Jellyfin::Support::fromJsonValue<bool>(source["EnableRealtimeMonitor"]);
m_enableLUFSScan = Jellyfin::Support::fromJsonValue<bool>(source["EnableLUFSScan"]);
m_enableChapterImageExtraction = Jellyfin::Support::fromJsonValue<bool>(source["EnableChapterImageExtraction"]);
m_extractChapterImagesDuringLibraryScan = Jellyfin::Support::fromJsonValue<bool>(source["ExtractChapterImagesDuringLibraryScan"]);
m_enableTrickplayImageExtraction = Jellyfin::Support::fromJsonValue<bool>(source["EnableTrickplayImageExtraction"]);
m_extractTrickplayImagesDuringLibraryScan = Jellyfin::Support::fromJsonValue<bool>(source["ExtractTrickplayImagesDuringLibraryScan"]);
m_pathInfos = Jellyfin::Support::fromJsonValue<QList<MediaPathInfo>>(source["PathInfos"]);
m_saveLocalMetadata = Jellyfin::Support::fromJsonValue<bool>(source["SaveLocalMetadata"]);
m_enableInternetProviders = Jellyfin::Support::fromJsonValue<bool>(source["EnableInternetProviders"]);
m_enableAutomaticSeriesGrouping = Jellyfin::Support::fromJsonValue<bool>(source["EnableAutomaticSeriesGrouping"]);
m_enableEmbeddedTitles = Jellyfin::Support::fromJsonValue<bool>(source["EnableEmbeddedTitles"]);
m_enableEmbeddedExtrasTitles = Jellyfin::Support::fromJsonValue<bool>(source["EnableEmbeddedExtrasTitles"]);
m_enableEmbeddedEpisodeInfos = Jellyfin::Support::fromJsonValue<bool>(source["EnableEmbeddedEpisodeInfos"]);
m_automaticRefreshIntervalDays = Jellyfin::Support::fromJsonValue<qint32>(source["AutomaticRefreshIntervalDays"]);
m_preferredMetadataLanguage = Jellyfin::Support::fromJsonValue<QString>(source["PreferredMetadataLanguage"]);
@ -150,11 +235,23 @@ void LibraryOptions::setFromJson(QJsonObject source) {
m_localMetadataReaderOrder = Jellyfin::Support::fromJsonValue<QStringList>(source["LocalMetadataReaderOrder"]);
m_disabledSubtitleFetchers = Jellyfin::Support::fromJsonValue<QStringList>(source["DisabledSubtitleFetchers"]);
m_subtitleFetcherOrder = Jellyfin::Support::fromJsonValue<QStringList>(source["SubtitleFetcherOrder"]);
m_disabledMediaSegmentProviders = Jellyfin::Support::fromJsonValue<QStringList>(source["DisabledMediaSegmentProviders"]);
m_mediaSegmentProvideOrder = Jellyfin::Support::fromJsonValue<QStringList>(source["MediaSegmentProvideOrder"]);
m_skipSubtitlesIfEmbeddedSubtitlesPresent = Jellyfin::Support::fromJsonValue<bool>(source["SkipSubtitlesIfEmbeddedSubtitlesPresent"]);
m_skipSubtitlesIfAudioTrackMatches = Jellyfin::Support::fromJsonValue<bool>(source["SkipSubtitlesIfAudioTrackMatches"]);
m_subtitleDownloadLanguages = Jellyfin::Support::fromJsonValue<QStringList>(source["SubtitleDownloadLanguages"]);
m_requirePerfectSubtitleMatch = Jellyfin::Support::fromJsonValue<bool>(source["RequirePerfectSubtitleMatch"]);
m_saveSubtitlesWithMedia = Jellyfin::Support::fromJsonValue<bool>(source["SaveSubtitlesWithMedia"]);
m_saveLyricsWithMedia = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["SaveLyricsWithMedia"]);
m_saveTrickplayWithMedia = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["SaveTrickplayWithMedia"]);
m_disabledLyricFetchers = Jellyfin::Support::fromJsonValue<QStringList>(source["DisabledLyricFetchers"]);
m_lyricFetcherOrder = Jellyfin::Support::fromJsonValue<QStringList>(source["LyricFetcherOrder"]);
m_preferNonstandardArtistsTag = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["PreferNonstandardArtistsTag"]);
m_useCustomTagDelimiters = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["UseCustomTagDelimiters"]);
m_customTagDelimiters = Jellyfin::Support::fromJsonValue<QStringList>(source["CustomTagDelimiters"]);
m_delimiterWhitelist = Jellyfin::Support::fromJsonValue<QStringList>(source["DelimiterWhitelist"]);
m_automaticallyAddToCollection = Jellyfin::Support::fromJsonValue<bool>(source["AutomaticallyAddToCollection"]);
m_allowEmbeddedSubtitles = Jellyfin::Support::fromJsonValue<EmbeddedSubtitleOptions>(source["AllowEmbeddedSubtitles"]);
m_typeOptions = Jellyfin::Support::fromJsonValue<QList<TypeOptions>>(source["TypeOptions"]);
}
@ -162,19 +259,20 @@ void LibraryOptions::setFromJson(QJsonObject source) {
QJsonObject LibraryOptions::toJson() const {
QJsonObject result;
result["Enabled"] = Jellyfin::Support::toJsonValue<bool>(m_enabled);
result["EnablePhotos"] = Jellyfin::Support::toJsonValue<bool>(m_enablePhotos);
result["EnableRealtimeMonitor"] = Jellyfin::Support::toJsonValue<bool>(m_enableRealtimeMonitor);
result["EnableLUFSScan"] = Jellyfin::Support::toJsonValue<bool>(m_enableLUFSScan);
result["EnableChapterImageExtraction"] = Jellyfin::Support::toJsonValue<bool>(m_enableChapterImageExtraction);
result["ExtractChapterImagesDuringLibraryScan"] = Jellyfin::Support::toJsonValue<bool>(m_extractChapterImagesDuringLibraryScan);
if (!(m_pathInfos.size() == 0)) {
result["PathInfos"] = Jellyfin::Support::toJsonValue<QList<MediaPathInfo>>(m_pathInfos);
}
result["EnableTrickplayImageExtraction"] = Jellyfin::Support::toJsonValue<bool>(m_enableTrickplayImageExtraction);
result["ExtractTrickplayImagesDuringLibraryScan"] = Jellyfin::Support::toJsonValue<bool>(m_extractTrickplayImagesDuringLibraryScan);
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["EnableEmbeddedExtrasTitles"] = Jellyfin::Support::toJsonValue<bool>(m_enableEmbeddedExtrasTitles);
result["EnableEmbeddedEpisodeInfos"] = Jellyfin::Support::toJsonValue<bool>(m_enableEmbeddedEpisodeInfos);
result["AutomaticRefreshIntervalDays"] = Jellyfin::Support::toJsonValue<qint32>(m_automaticRefreshIntervalDays);
@ -187,36 +285,22 @@ QJsonObject LibraryOptions::toJson() const {
result["MetadataCountryCode"] = Jellyfin::Support::toJsonValue<QString>(m_metadataCountryCode);
}
if (!(m_seasonZeroDisplayName.isNull())) {
result["SeasonZeroDisplayName"] = Jellyfin::Support::toJsonValue<QString>(m_seasonZeroDisplayName);
}
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);
}
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["DisabledSubtitleFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledSubtitleFetchers);
result["SubtitleFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_subtitleFetcherOrder);
result["DisabledMediaSegmentProviders"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledMediaSegmentProviders);
result["MediaSegmentProvideOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_mediaSegmentProvideOrder);
result["SkipSubtitlesIfEmbeddedSubtitlesPresent"] = Jellyfin::Support::toJsonValue<bool>(m_skipSubtitlesIfEmbeddedSubtitlesPresent);
result["SkipSubtitlesIfAudioTrackMatches"] = Jellyfin::Support::toJsonValue<bool>(m_skipSubtitlesIfAudioTrackMatches);
@ -226,14 +310,26 @@ QJsonObject LibraryOptions::toJson() const {
result["RequirePerfectSubtitleMatch"] = Jellyfin::Support::toJsonValue<bool>(m_requirePerfectSubtitleMatch);
result["SaveSubtitlesWithMedia"] = Jellyfin::Support::toJsonValue<bool>(m_saveSubtitlesWithMedia);
if (!(m_typeOptions.size() == 0)) {
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<TypeOptions>>(m_typeOptions);
}
result["SaveLyricsWithMedia"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_saveLyricsWithMedia);
result["SaveTrickplayWithMedia"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_saveTrickplayWithMedia);
result["DisabledLyricFetchers"] = Jellyfin::Support::toJsonValue<QStringList>(m_disabledLyricFetchers);
result["LyricFetcherOrder"] = Jellyfin::Support::toJsonValue<QStringList>(m_lyricFetcherOrder);
result["PreferNonstandardArtistsTag"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_preferNonstandardArtistsTag);
result["UseCustomTagDelimiters"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_useCustomTagDelimiters);
result["CustomTagDelimiters"] = Jellyfin::Support::toJsonValue<QStringList>(m_customTagDelimiters);
result["DelimiterWhitelist"] = Jellyfin::Support::toJsonValue<QStringList>(m_delimiterWhitelist);
result["AutomaticallyAddToCollection"] = Jellyfin::Support::toJsonValue<bool>(m_automaticallyAddToCollection);
result["AllowEmbeddedSubtitles"] = Jellyfin::Support::toJsonValue<EmbeddedSubtitleOptions>(m_allowEmbeddedSubtitles);
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<TypeOptions>>(m_typeOptions);
return result;
}
bool LibraryOptions::enabled() const { return m_enabled; }
void LibraryOptions::setEnabled(bool newEnabled) {
m_enabled = newEnabled;
}
bool LibraryOptions::enablePhotos() const { return m_enablePhotos; }
void LibraryOptions::setEnablePhotos(bool newEnablePhotos) {
@ -246,6 +342,12 @@ void LibraryOptions::setEnableRealtimeMonitor(bool newEnableRealtimeMonitor) {
m_enableRealtimeMonitor = newEnableRealtimeMonitor;
}
bool LibraryOptions::enableLUFSScan() const { return m_enableLUFSScan; }
void LibraryOptions::setEnableLUFSScan(bool newEnableLUFSScan) {
m_enableLUFSScan = newEnableLUFSScan;
}
bool LibraryOptions::enableChapterImageExtraction() const { return m_enableChapterImageExtraction; }
void LibraryOptions::setEnableChapterImageExtraction(bool newEnableChapterImageExtraction) {
@ -258,19 +360,24 @@ void LibraryOptions::setExtractChapterImagesDuringLibraryScan(bool newExtractCha
m_extractChapterImagesDuringLibraryScan = newExtractChapterImagesDuringLibraryScan;
}
bool LibraryOptions::enableTrickplayImageExtraction() const { return m_enableTrickplayImageExtraction; }
void LibraryOptions::setEnableTrickplayImageExtraction(bool newEnableTrickplayImageExtraction) {
m_enableTrickplayImageExtraction = newEnableTrickplayImageExtraction;
}
bool LibraryOptions::extractTrickplayImagesDuringLibraryScan() const { return m_extractTrickplayImagesDuringLibraryScan; }
void LibraryOptions::setExtractTrickplayImagesDuringLibraryScan(bool newExtractTrickplayImagesDuringLibraryScan) {
m_extractTrickplayImagesDuringLibraryScan = newExtractTrickplayImagesDuringLibraryScan;
}
QList<MediaPathInfo> LibraryOptions::pathInfos() const { return m_pathInfos; }
void LibraryOptions::setPathInfos(QList<MediaPathInfo> newPathInfos) {
m_pathInfos = newPathInfos;
}
bool LibraryOptions::pathInfosNull() const {
return m_pathInfos.size() == 0;
}
void LibraryOptions::setPathInfosNull() {
m_pathInfos.clear();
}
bool LibraryOptions::saveLocalMetadata() const { return m_saveLocalMetadata; }
void LibraryOptions::setSaveLocalMetadata(bool newSaveLocalMetadata) {
@ -295,6 +402,12 @@ void LibraryOptions::setEnableEmbeddedTitles(bool newEnableEmbeddedTitles) {
m_enableEmbeddedTitles = newEnableEmbeddedTitles;
}
bool LibraryOptions::enableEmbeddedExtrasTitles() const { return m_enableEmbeddedExtrasTitles; }
void LibraryOptions::setEnableEmbeddedExtrasTitles(bool newEnableEmbeddedExtrasTitles) {
m_enableEmbeddedExtrasTitles = newEnableEmbeddedExtrasTitles;
}
bool LibraryOptions::enableEmbeddedEpisodeInfos() const { return m_enableEmbeddedEpisodeInfos; }
void LibraryOptions::setEnableEmbeddedEpisodeInfos(bool newEnableEmbeddedEpisodeInfos) {
@ -338,14 +451,7 @@ QString LibraryOptions::seasonZeroDisplayName() const { return m_seasonZeroDispl
void LibraryOptions::setSeasonZeroDisplayName(QString newSeasonZeroDisplayName) {
m_seasonZeroDisplayName = newSeasonZeroDisplayName;
}
bool LibraryOptions::seasonZeroDisplayNameNull() const {
return m_seasonZeroDisplayName.isNull();
}
void LibraryOptions::setSeasonZeroDisplayNameNull() {
m_seasonZeroDisplayName.clear();
}
QStringList LibraryOptions::metadataSavers() const { return m_metadataSavers; }
void LibraryOptions::setMetadataSavers(QStringList newMetadataSavers) {
@ -364,14 +470,7 @@ QStringList LibraryOptions::disabledLocalMetadataReaders() const { return m_disa
void LibraryOptions::setDisabledLocalMetadataReaders(QStringList newDisabledLocalMetadataReaders) {
m_disabledLocalMetadataReaders = newDisabledLocalMetadataReaders;
}
bool LibraryOptions::disabledLocalMetadataReadersNull() const {
return m_disabledLocalMetadataReaders.size() == 0;
}
void LibraryOptions::setDisabledLocalMetadataReadersNull() {
m_disabledLocalMetadataReaders.clear();
}
QStringList LibraryOptions::localMetadataReaderOrder() const { return m_localMetadataReaderOrder; }
void LibraryOptions::setLocalMetadataReaderOrder(QStringList newLocalMetadataReaderOrder) {
@ -390,27 +489,25 @@ QStringList LibraryOptions::disabledSubtitleFetchers() const { return m_disabled
void LibraryOptions::setDisabledSubtitleFetchers(QStringList newDisabledSubtitleFetchers) {
m_disabledSubtitleFetchers = newDisabledSubtitleFetchers;
}
bool LibraryOptions::disabledSubtitleFetchersNull() const {
return m_disabledSubtitleFetchers.size() == 0;
}
void LibraryOptions::setDisabledSubtitleFetchersNull() {
m_disabledSubtitleFetchers.clear();
}
QStringList LibraryOptions::subtitleFetcherOrder() const { return m_subtitleFetcherOrder; }
void LibraryOptions::setSubtitleFetcherOrder(QStringList newSubtitleFetcherOrder) {
m_subtitleFetcherOrder = newSubtitleFetcherOrder;
}
bool LibraryOptions::subtitleFetcherOrderNull() const {
return m_subtitleFetcherOrder.size() == 0;
QStringList LibraryOptions::disabledMediaSegmentProviders() const { return m_disabledMediaSegmentProviders; }
void LibraryOptions::setDisabledMediaSegmentProviders(QStringList newDisabledMediaSegmentProviders) {
m_disabledMediaSegmentProviders = newDisabledMediaSegmentProviders;
}
void LibraryOptions::setSubtitleFetcherOrderNull() {
m_subtitleFetcherOrder.clear();
QStringList LibraryOptions::mediaSegmentProvideOrder() const { return m_mediaSegmentProvideOrder; }
void LibraryOptions::setMediaSegmentProvideOrder(QStringList newMediaSegmentProvideOrder) {
m_mediaSegmentProvideOrder = newMediaSegmentProvideOrder;
}
bool LibraryOptions::skipSubtitlesIfEmbeddedSubtitlesPresent() const { return m_skipSubtitlesIfEmbeddedSubtitlesPresent; }
void LibraryOptions::setSkipSubtitlesIfEmbeddedSubtitlesPresent(bool newSkipSubtitlesIfEmbeddedSubtitlesPresent) {
@ -448,19 +545,72 @@ void LibraryOptions::setSaveSubtitlesWithMedia(bool newSaveSubtitlesWithMedia) {
m_saveSubtitlesWithMedia = newSaveSubtitlesWithMedia;
}
std::optional<bool> LibraryOptions::saveLyricsWithMedia() const { return m_saveLyricsWithMedia; }
void LibraryOptions::setSaveLyricsWithMedia(std::optional<bool> newSaveLyricsWithMedia) {
m_saveLyricsWithMedia = newSaveLyricsWithMedia;
}
std::optional<bool> LibraryOptions::saveTrickplayWithMedia() const { return m_saveTrickplayWithMedia; }
void LibraryOptions::setSaveTrickplayWithMedia(std::optional<bool> newSaveTrickplayWithMedia) {
m_saveTrickplayWithMedia = newSaveTrickplayWithMedia;
}
QStringList LibraryOptions::disabledLyricFetchers() const { return m_disabledLyricFetchers; }
void LibraryOptions::setDisabledLyricFetchers(QStringList newDisabledLyricFetchers) {
m_disabledLyricFetchers = newDisabledLyricFetchers;
}
QStringList LibraryOptions::lyricFetcherOrder() const { return m_lyricFetcherOrder; }
void LibraryOptions::setLyricFetcherOrder(QStringList newLyricFetcherOrder) {
m_lyricFetcherOrder = newLyricFetcherOrder;
}
std::optional<bool> LibraryOptions::preferNonstandardArtistsTag() const { return m_preferNonstandardArtistsTag; }
void LibraryOptions::setPreferNonstandardArtistsTag(std::optional<bool> newPreferNonstandardArtistsTag) {
m_preferNonstandardArtistsTag = newPreferNonstandardArtistsTag;
}
std::optional<bool> LibraryOptions::useCustomTagDelimiters() const { return m_useCustomTagDelimiters; }
void LibraryOptions::setUseCustomTagDelimiters(std::optional<bool> newUseCustomTagDelimiters) {
m_useCustomTagDelimiters = newUseCustomTagDelimiters;
}
QStringList LibraryOptions::customTagDelimiters() const { return m_customTagDelimiters; }
void LibraryOptions::setCustomTagDelimiters(QStringList newCustomTagDelimiters) {
m_customTagDelimiters = newCustomTagDelimiters;
}
QStringList LibraryOptions::delimiterWhitelist() const { return m_delimiterWhitelist; }
void LibraryOptions::setDelimiterWhitelist(QStringList newDelimiterWhitelist) {
m_delimiterWhitelist = newDelimiterWhitelist;
}
bool LibraryOptions::automaticallyAddToCollection() const { return m_automaticallyAddToCollection; }
void LibraryOptions::setAutomaticallyAddToCollection(bool newAutomaticallyAddToCollection) {
m_automaticallyAddToCollection = newAutomaticallyAddToCollection;
}
EmbeddedSubtitleOptions LibraryOptions::allowEmbeddedSubtitles() const { return m_allowEmbeddedSubtitles; }
void LibraryOptions::setAllowEmbeddedSubtitles(EmbeddedSubtitleOptions newAllowEmbeddedSubtitles) {
m_allowEmbeddedSubtitles = newAllowEmbeddedSubtitles;
}
QList<TypeOptions> LibraryOptions::typeOptions() const { return m_typeOptions; }
void LibraryOptions::setTypeOptions(QList<TypeOptions> newTypeOptions) {
m_typeOptions = newTypeOptions;
}
bool LibraryOptions::typeOptionsNull() const {
return m_typeOptions.size() == 0;
}
void LibraryOptions::setTypeOptionsNull() {
m_typeOptions.clear();
}
} // NS DTO

View file

@ -33,12 +33,27 @@ namespace Jellyfin {
namespace DTO {
LibraryOptionsResultDto::LibraryOptionsResultDto() {}
LibraryOptionsResultDto::LibraryOptionsResultDto (
QList<LibraryOptionInfoDto> metadataSavers,
QList<LibraryOptionInfoDto> metadataReaders,
QList<LibraryOptionInfoDto> subtitleFetchers,
QList<LibraryOptionInfoDto> lyricFetchers,
QList<LibraryTypeOptionsDto> typeOptions
) :
m_metadataSavers(metadataSavers),
m_metadataReaders(metadataReaders),
m_subtitleFetchers(subtitleFetchers),
m_lyricFetchers(lyricFetchers),
m_typeOptions(typeOptions) { }
LibraryOptionsResultDto::LibraryOptionsResultDto(const LibraryOptionsResultDto &other) :
m_metadataSavers(other.m_metadataSavers),
m_metadataReaders(other.m_metadataReaders),
m_subtitleFetchers(other.m_subtitleFetchers),
m_lyricFetchers(other.m_lyricFetchers),
m_typeOptions(other.m_typeOptions){}
@ -46,6 +61,7 @@ void LibraryOptionsResultDto::replaceData(LibraryOptionsResultDto &other) {
m_metadataSavers = other.m_metadataSavers;
m_metadataReaders = other.m_metadataReaders;
m_subtitleFetchers = other.m_subtitleFetchers;
m_lyricFetchers = other.m_lyricFetchers;
m_typeOptions = other.m_typeOptions;
}
@ -60,6 +76,7 @@ void LibraryOptionsResultDto::setFromJson(QJsonObject source) {
m_metadataSavers = Jellyfin::Support::fromJsonValue<QList<LibraryOptionInfoDto>>(source["MetadataSavers"]);
m_metadataReaders = Jellyfin::Support::fromJsonValue<QList<LibraryOptionInfoDto>>(source["MetadataReaders"]);
m_subtitleFetchers = Jellyfin::Support::fromJsonValue<QList<LibraryOptionInfoDto>>(source["SubtitleFetchers"]);
m_lyricFetchers = Jellyfin::Support::fromJsonValue<QList<LibraryOptionInfoDto>>(source["LyricFetchers"]);
m_typeOptions = Jellyfin::Support::fromJsonValue<QList<LibraryTypeOptionsDto>>(source["TypeOptions"]);
}
@ -67,26 +84,11 @@ void LibraryOptionsResultDto::setFromJson(QJsonObject source) {
QJsonObject LibraryOptionsResultDto::toJson() const {
QJsonObject result;
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);
}
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["LyricFetchers"] = Jellyfin::Support::toJsonValue<QList<LibraryOptionInfoDto>>(m_lyricFetchers);
result["TypeOptions"] = Jellyfin::Support::toJsonValue<QList<LibraryTypeOptionsDto>>(m_typeOptions);
return result;
}
@ -95,53 +97,31 @@ QList<LibraryOptionInfoDto> LibraryOptionsResultDto::metadataSavers() const { re
void LibraryOptionsResultDto::setMetadataSavers(QList<LibraryOptionInfoDto> newMetadataSavers) {
m_metadataSavers = newMetadataSavers;
}
bool LibraryOptionsResultDto::metadataSaversNull() const {
return m_metadataSavers.size() == 0;
}
void LibraryOptionsResultDto::setMetadataSaversNull() {
m_metadataSavers.clear();
}
QList<LibraryOptionInfoDto> LibraryOptionsResultDto::metadataReaders() const { return m_metadataReaders; }
void LibraryOptionsResultDto::setMetadataReaders(QList<LibraryOptionInfoDto> newMetadataReaders) {
m_metadataReaders = newMetadataReaders;
}
bool LibraryOptionsResultDto::metadataReadersNull() const {
return m_metadataReaders.size() == 0;
}
void LibraryOptionsResultDto::setMetadataReadersNull() {
m_metadataReaders.clear();
}
QList<LibraryOptionInfoDto> LibraryOptionsResultDto::subtitleFetchers() const { return m_subtitleFetchers; }
void LibraryOptionsResultDto::setSubtitleFetchers(QList<LibraryOptionInfoDto> newSubtitleFetchers) {
m_subtitleFetchers = newSubtitleFetchers;
}
bool LibraryOptionsResultDto::subtitleFetchersNull() const {
return m_subtitleFetchers.size() == 0;
QList<LibraryOptionInfoDto> LibraryOptionsResultDto::lyricFetchers() const { return m_lyricFetchers; }
void LibraryOptionsResultDto::setLyricFetchers(QList<LibraryOptionInfoDto> newLyricFetchers) {
m_lyricFetchers = newLyricFetchers;
}
void LibraryOptionsResultDto::setSubtitleFetchersNull() {
m_subtitleFetchers.clear();
}
QList<LibraryTypeOptionsDto> LibraryOptionsResultDto::typeOptions() const { return m_typeOptions; }
void LibraryOptionsResultDto::setTypeOptions(QList<LibraryTypeOptionsDto> newTypeOptions) {
m_typeOptions = newTypeOptions;
}
bool LibraryOptionsResultDto::typeOptionsNull() const {
return m_typeOptions.size() == 0;
}
void LibraryOptionsResultDto::setTypeOptionsNull() {
m_typeOptions.clear();
}
} // NS DTO

View file

@ -33,6 +33,18 @@ namespace Jellyfin {
namespace DTO {
LibraryTypeOptionsDto::LibraryTypeOptionsDto() {}
LibraryTypeOptionsDto::LibraryTypeOptionsDto (
QList<LibraryOptionInfoDto> metadataFetchers,
QList<LibraryOptionInfoDto> imageFetchers,
QList<ImageType> supportedImageTypes,
QList<ImageOption> defaultImageOptions
) :
m_metadataFetchers(metadataFetchers),
m_imageFetchers(imageFetchers),
m_supportedImageTypes(supportedImageTypes),
m_defaultImageOptions(defaultImageOptions) { }
LibraryTypeOptionsDto::LibraryTypeOptionsDto(const LibraryTypeOptionsDto &other) :
@ -75,26 +87,10 @@ QJsonObject LibraryTypeOptionsDto::toJson() const {
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);
}
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);
return result;
}
@ -116,53 +112,25 @@ QList<LibraryOptionInfoDto> LibraryTypeOptionsDto::metadataFetchers() const { re
void LibraryTypeOptionsDto::setMetadataFetchers(QList<LibraryOptionInfoDto> newMetadataFetchers) {
m_metadataFetchers = newMetadataFetchers;
}
bool LibraryTypeOptionsDto::metadataFetchersNull() const {
return m_metadataFetchers.size() == 0;
}
void LibraryTypeOptionsDto::setMetadataFetchersNull() {
m_metadataFetchers.clear();
}
QList<LibraryOptionInfoDto> LibraryTypeOptionsDto::imageFetchers() const { return m_imageFetchers; }
void LibraryTypeOptionsDto::setImageFetchers(QList<LibraryOptionInfoDto> newImageFetchers) {
m_imageFetchers = newImageFetchers;
}
bool LibraryTypeOptionsDto::imageFetchersNull() const {
return m_imageFetchers.size() == 0;
}
void LibraryTypeOptionsDto::setImageFetchersNull() {
m_imageFetchers.clear();
}
QList<ImageType> LibraryTypeOptionsDto::supportedImageTypes() const { return m_supportedImageTypes; }
void LibraryTypeOptionsDto::setSupportedImageTypes(QList<ImageType> newSupportedImageTypes) {
m_supportedImageTypes = newSupportedImageTypes;
}
bool LibraryTypeOptionsDto::supportedImageTypesNull() const {
return m_supportedImageTypes.size() == 0;
}
void LibraryTypeOptionsDto::setSupportedImageTypesNull() {
m_supportedImageTypes.clear();
}
QList<ImageOption> LibraryTypeOptionsDto::defaultImageOptions() const { return m_defaultImageOptions; }
void LibraryTypeOptionsDto::setDefaultImageOptions(QList<ImageOption> newDefaultImageOptions) {
m_defaultImageOptions = newDefaultImageOptions;
}
bool LibraryTypeOptionsDto::defaultImageOptionsNull() const {
return m_defaultImageOptions.size() == 0;
}
void LibraryTypeOptionsDto::setDefaultImageOptionsNull() {
m_defaultImageOptions.clear();
}
} // NS DTO

View file

@ -34,8 +34,20 @@ namespace DTO {
LibraryUpdateInfo::LibraryUpdateInfo() {}
LibraryUpdateInfo::LibraryUpdateInfo (
QStringList foldersAddedTo,
QStringList foldersRemovedFrom,
QStringList itemsAdded,
QStringList itemsRemoved,
QStringList itemsUpdated,
QStringList collectionFolders,
bool isEmpty
) :
m_foldersAddedTo(foldersAddedTo),
m_foldersRemovedFrom(foldersRemovedFrom),
m_itemsAdded(itemsAdded),
m_itemsRemoved(itemsRemoved),
m_itemsUpdated(itemsUpdated),
m_collectionFolders(collectionFolders),
m_isEmpty(isEmpty) { }
@ -82,36 +94,12 @@ void LibraryUpdateInfo::setFromJson(QJsonObject source) {
QJsonObject LibraryUpdateInfo::toJson() const {
QJsonObject result;
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["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);
return result;
}
@ -121,79 +109,37 @@ QStringList LibraryUpdateInfo::foldersAddedTo() const { return m_foldersAddedTo;
void LibraryUpdateInfo::setFoldersAddedTo(QStringList newFoldersAddedTo) {
m_foldersAddedTo = newFoldersAddedTo;
}
bool LibraryUpdateInfo::foldersAddedToNull() const {
return m_foldersAddedTo.size() == 0;
}
void LibraryUpdateInfo::setFoldersAddedToNull() {
m_foldersAddedTo.clear();
}
QStringList LibraryUpdateInfo::foldersRemovedFrom() const { return m_foldersRemovedFrom; }
void LibraryUpdateInfo::setFoldersRemovedFrom(QStringList newFoldersRemovedFrom) {
m_foldersRemovedFrom = newFoldersRemovedFrom;
}
bool LibraryUpdateInfo::foldersRemovedFromNull() const {
return m_foldersRemovedFrom.size() == 0;
}
void LibraryUpdateInfo::setFoldersRemovedFromNull() {
m_foldersRemovedFrom.clear();
}
QStringList LibraryUpdateInfo::itemsAdded() const { return m_itemsAdded; }
void LibraryUpdateInfo::setItemsAdded(QStringList newItemsAdded) {
m_itemsAdded = newItemsAdded;
}
bool LibraryUpdateInfo::itemsAddedNull() const {
return m_itemsAdded.size() == 0;
}
void LibraryUpdateInfo::setItemsAddedNull() {
m_itemsAdded.clear();
}
QStringList LibraryUpdateInfo::itemsRemoved() const { return m_itemsRemoved; }
void LibraryUpdateInfo::setItemsRemoved(QStringList newItemsRemoved) {
m_itemsRemoved = newItemsRemoved;
}
bool LibraryUpdateInfo::itemsRemovedNull() const {
return m_itemsRemoved.size() == 0;
}
void LibraryUpdateInfo::setItemsRemovedNull() {
m_itemsRemoved.clear();
}
QStringList LibraryUpdateInfo::itemsUpdated() const { return m_itemsUpdated; }
void LibraryUpdateInfo::setItemsUpdated(QStringList newItemsUpdated) {
m_itemsUpdated = newItemsUpdated;
}
bool LibraryUpdateInfo::itemsUpdatedNull() const {
return m_itemsUpdated.size() == 0;
}
void LibraryUpdateInfo::setItemsUpdatedNull() {
m_itemsUpdated.clear();
}
QStringList LibraryUpdateInfo::collectionFolders() const { return m_collectionFolders; }
void LibraryUpdateInfo::setCollectionFolders(QStringList newCollectionFolders) {
m_collectionFolders = newCollectionFolders;
}
bool LibraryUpdateInfo::collectionFoldersNull() const {
return m_collectionFolders.size() == 0;
}
void LibraryUpdateInfo::setCollectionFoldersNull() {
m_collectionFolders.clear();
}
bool LibraryUpdateInfo::isEmpty() const { return m_isEmpty; }
void LibraryUpdateInfo::setIsEmpty(bool newIsEmpty) {

View file

@ -34,9 +34,13 @@ namespace DTO {
LiveTvInfo::LiveTvInfo() {}
LiveTvInfo::LiveTvInfo (
bool isEnabled
QList<LiveTvServiceInfo> services,
bool isEnabled,
QStringList enabledUsers
) :
m_isEnabled(isEnabled) { }
m_services(services),
m_isEnabled(isEnabled),
m_enabledUsers(enabledUsers) { }
@ -70,17 +74,9 @@ void LiveTvInfo::setFromJson(QJsonObject source) {
QJsonObject LiveTvInfo::toJson() const {
QJsonObject result;
if (!(m_services.size() == 0)) {
result["Services"] = Jellyfin::Support::toJsonValue<QList<LiveTvServiceInfo>>(m_services);
}
result["Services"] = Jellyfin::Support::toJsonValue<QList<LiveTvServiceInfo>>(m_services);
result["IsEnabled"] = Jellyfin::Support::toJsonValue<bool>(m_isEnabled);
if (!(m_enabledUsers.size() == 0)) {
result["EnabledUsers"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledUsers);
}
result["EnabledUsers"] = Jellyfin::Support::toJsonValue<QStringList>(m_enabledUsers);
return result;
}
@ -89,14 +85,7 @@ QList<LiveTvServiceInfo> LiveTvInfo::services() const { return m_services; }
void LiveTvInfo::setServices(QList<LiveTvServiceInfo> newServices) {
m_services = newServices;
}
bool LiveTvInfo::servicesNull() const {
return m_services.size() == 0;
}
void LiveTvInfo::setServicesNull() {
m_services.clear();
}
bool LiveTvInfo::isEnabled() const { return m_isEnabled; }
void LiveTvInfo::setIsEnabled(bool newIsEnabled) {
@ -108,14 +97,7 @@ QStringList LiveTvInfo::enabledUsers() const { return m_enabledUsers; }
void LiveTvInfo::setEnabledUsers(QStringList newEnabledUsers) {
m_enabledUsers = newEnabledUsers;
}
bool LiveTvInfo::enabledUsersNull() const {
return m_enabledUsers.size() == 0;
}
void LiveTvInfo::setEnabledUsersNull() {
m_enabledUsers.clear();
}
} // NS DTO

View file

@ -0,0 +1,345 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/livetvoptions.h>
namespace Jellyfin {
namespace DTO {
LiveTvOptions::LiveTvOptions() {}
LiveTvOptions::LiveTvOptions (
bool enableRecordingSubfolders,
bool enableOriginalAudioWithEncodedRecordings,
qint32 prePaddingSeconds,
qint32 postPaddingSeconds,
bool saveRecordingNFO,
bool saveRecordingImages
) :
m_enableRecordingSubfolders(enableRecordingSubfolders),
m_enableOriginalAudioWithEncodedRecordings(enableOriginalAudioWithEncodedRecordings),
m_prePaddingSeconds(prePaddingSeconds),
m_postPaddingSeconds(postPaddingSeconds),
m_saveRecordingNFO(saveRecordingNFO),
m_saveRecordingImages(saveRecordingImages) { }
LiveTvOptions::LiveTvOptions(const LiveTvOptions &other) :
m_guideDays(other.m_guideDays),
m_recordingPath(other.m_recordingPath),
m_movieRecordingPath(other.m_movieRecordingPath),
m_seriesRecordingPath(other.m_seriesRecordingPath),
m_enableRecordingSubfolders(other.m_enableRecordingSubfolders),
m_enableOriginalAudioWithEncodedRecordings(other.m_enableOriginalAudioWithEncodedRecordings),
m_tunerHosts(other.m_tunerHosts),
m_listingProviders(other.m_listingProviders),
m_prePaddingSeconds(other.m_prePaddingSeconds),
m_postPaddingSeconds(other.m_postPaddingSeconds),
m_mediaLocationsCreated(other.m_mediaLocationsCreated),
m_recordingPostProcessor(other.m_recordingPostProcessor),
m_recordingPostProcessorArguments(other.m_recordingPostProcessorArguments),
m_saveRecordingNFO(other.m_saveRecordingNFO),
m_saveRecordingImages(other.m_saveRecordingImages){}
void LiveTvOptions::replaceData(LiveTvOptions &other) {
m_guideDays = other.m_guideDays;
m_recordingPath = other.m_recordingPath;
m_movieRecordingPath = other.m_movieRecordingPath;
m_seriesRecordingPath = other.m_seriesRecordingPath;
m_enableRecordingSubfolders = other.m_enableRecordingSubfolders;
m_enableOriginalAudioWithEncodedRecordings = other.m_enableOriginalAudioWithEncodedRecordings;
m_tunerHosts = other.m_tunerHosts;
m_listingProviders = other.m_listingProviders;
m_prePaddingSeconds = other.m_prePaddingSeconds;
m_postPaddingSeconds = other.m_postPaddingSeconds;
m_mediaLocationsCreated = other.m_mediaLocationsCreated;
m_recordingPostProcessor = other.m_recordingPostProcessor;
m_recordingPostProcessorArguments = other.m_recordingPostProcessorArguments;
m_saveRecordingNFO = other.m_saveRecordingNFO;
m_saveRecordingImages = other.m_saveRecordingImages;
}
LiveTvOptions LiveTvOptions::fromJson(QJsonObject source) {
LiveTvOptions instance;
instance.setFromJson(source);
return instance;
}
void LiveTvOptions::setFromJson(QJsonObject source) {
m_guideDays = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["GuideDays"]);
m_recordingPath = Jellyfin::Support::fromJsonValue<QString>(source["RecordingPath"]);
m_movieRecordingPath = Jellyfin::Support::fromJsonValue<QString>(source["MovieRecordingPath"]);
m_seriesRecordingPath = Jellyfin::Support::fromJsonValue<QString>(source["SeriesRecordingPath"]);
m_enableRecordingSubfolders = Jellyfin::Support::fromJsonValue<bool>(source["EnableRecordingSubfolders"]);
m_enableOriginalAudioWithEncodedRecordings = Jellyfin::Support::fromJsonValue<bool>(source["EnableOriginalAudioWithEncodedRecordings"]);
m_tunerHosts = Jellyfin::Support::fromJsonValue<QList<TunerHostInfo>>(source["TunerHosts"]);
m_listingProviders = Jellyfin::Support::fromJsonValue<QList<ListingsProviderInfo>>(source["ListingProviders"]);
m_prePaddingSeconds = Jellyfin::Support::fromJsonValue<qint32>(source["PrePaddingSeconds"]);
m_postPaddingSeconds = Jellyfin::Support::fromJsonValue<qint32>(source["PostPaddingSeconds"]);
m_mediaLocationsCreated = Jellyfin::Support::fromJsonValue<QStringList>(source["MediaLocationsCreated"]);
m_recordingPostProcessor = Jellyfin::Support::fromJsonValue<QString>(source["RecordingPostProcessor"]);
m_recordingPostProcessorArguments = Jellyfin::Support::fromJsonValue<QString>(source["RecordingPostProcessorArguments"]);
m_saveRecordingNFO = Jellyfin::Support::fromJsonValue<bool>(source["SaveRecordingNFO"]);
m_saveRecordingImages = Jellyfin::Support::fromJsonValue<bool>(source["SaveRecordingImages"]);
}
QJsonObject LiveTvOptions::toJson() const {
QJsonObject result;
if (!(!m_guideDays.has_value())) {
result["GuideDays"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_guideDays);
}
if (!(m_recordingPath.isNull())) {
result["RecordingPath"] = Jellyfin::Support::toJsonValue<QString>(m_recordingPath);
}
if (!(m_movieRecordingPath.isNull())) {
result["MovieRecordingPath"] = Jellyfin::Support::toJsonValue<QString>(m_movieRecordingPath);
}
if (!(m_seriesRecordingPath.isNull())) {
result["SeriesRecordingPath"] = Jellyfin::Support::toJsonValue<QString>(m_seriesRecordingPath);
}
result["EnableRecordingSubfolders"] = Jellyfin::Support::toJsonValue<bool>(m_enableRecordingSubfolders);
result["EnableOriginalAudioWithEncodedRecordings"] = Jellyfin::Support::toJsonValue<bool>(m_enableOriginalAudioWithEncodedRecordings);
if (!(m_tunerHosts.size() == 0)) {
result["TunerHosts"] = Jellyfin::Support::toJsonValue<QList<TunerHostInfo>>(m_tunerHosts);
}
if (!(m_listingProviders.size() == 0)) {
result["ListingProviders"] = Jellyfin::Support::toJsonValue<QList<ListingsProviderInfo>>(m_listingProviders);
}
result["PrePaddingSeconds"] = Jellyfin::Support::toJsonValue<qint32>(m_prePaddingSeconds);
result["PostPaddingSeconds"] = Jellyfin::Support::toJsonValue<qint32>(m_postPaddingSeconds);
if (!(m_mediaLocationsCreated.size() == 0)) {
result["MediaLocationsCreated"] = Jellyfin::Support::toJsonValue<QStringList>(m_mediaLocationsCreated);
}
if (!(m_recordingPostProcessor.isNull())) {
result["RecordingPostProcessor"] = Jellyfin::Support::toJsonValue<QString>(m_recordingPostProcessor);
}
if (!(m_recordingPostProcessorArguments.isNull())) {
result["RecordingPostProcessorArguments"] = Jellyfin::Support::toJsonValue<QString>(m_recordingPostProcessorArguments);
}
result["SaveRecordingNFO"] = Jellyfin::Support::toJsonValue<bool>(m_saveRecordingNFO);
result["SaveRecordingImages"] = Jellyfin::Support::toJsonValue<bool>(m_saveRecordingImages);
return result;
}
std::optional<qint32> LiveTvOptions::guideDays() const { return m_guideDays; }
void LiveTvOptions::setGuideDays(std::optional<qint32> newGuideDays) {
m_guideDays = newGuideDays;
}
bool LiveTvOptions::guideDaysNull() const {
return !m_guideDays.has_value();
}
void LiveTvOptions::setGuideDaysNull() {
m_guideDays = std::nullopt;
}
QString LiveTvOptions::recordingPath() const { return m_recordingPath; }
void LiveTvOptions::setRecordingPath(QString newRecordingPath) {
m_recordingPath = newRecordingPath;
}
bool LiveTvOptions::recordingPathNull() const {
return m_recordingPath.isNull();
}
void LiveTvOptions::setRecordingPathNull() {
m_recordingPath.clear();
}
QString LiveTvOptions::movieRecordingPath() const { return m_movieRecordingPath; }
void LiveTvOptions::setMovieRecordingPath(QString newMovieRecordingPath) {
m_movieRecordingPath = newMovieRecordingPath;
}
bool LiveTvOptions::movieRecordingPathNull() const {
return m_movieRecordingPath.isNull();
}
void LiveTvOptions::setMovieRecordingPathNull() {
m_movieRecordingPath.clear();
}
QString LiveTvOptions::seriesRecordingPath() const { return m_seriesRecordingPath; }
void LiveTvOptions::setSeriesRecordingPath(QString newSeriesRecordingPath) {
m_seriesRecordingPath = newSeriesRecordingPath;
}
bool LiveTvOptions::seriesRecordingPathNull() const {
return m_seriesRecordingPath.isNull();
}
void LiveTvOptions::setSeriesRecordingPathNull() {
m_seriesRecordingPath.clear();
}
bool LiveTvOptions::enableRecordingSubfolders() const { return m_enableRecordingSubfolders; }
void LiveTvOptions::setEnableRecordingSubfolders(bool newEnableRecordingSubfolders) {
m_enableRecordingSubfolders = newEnableRecordingSubfolders;
}
bool LiveTvOptions::enableOriginalAudioWithEncodedRecordings() const { return m_enableOriginalAudioWithEncodedRecordings; }
void LiveTvOptions::setEnableOriginalAudioWithEncodedRecordings(bool newEnableOriginalAudioWithEncodedRecordings) {
m_enableOriginalAudioWithEncodedRecordings = newEnableOriginalAudioWithEncodedRecordings;
}
QList<TunerHostInfo> LiveTvOptions::tunerHosts() const { return m_tunerHosts; }
void LiveTvOptions::setTunerHosts(QList<TunerHostInfo> newTunerHosts) {
m_tunerHosts = newTunerHosts;
}
bool LiveTvOptions::tunerHostsNull() const {
return m_tunerHosts.size() == 0;
}
void LiveTvOptions::setTunerHostsNull() {
m_tunerHosts.clear();
}
QList<ListingsProviderInfo> LiveTvOptions::listingProviders() const { return m_listingProviders; }
void LiveTvOptions::setListingProviders(QList<ListingsProviderInfo> newListingProviders) {
m_listingProviders = newListingProviders;
}
bool LiveTvOptions::listingProvidersNull() const {
return m_listingProviders.size() == 0;
}
void LiveTvOptions::setListingProvidersNull() {
m_listingProviders.clear();
}
qint32 LiveTvOptions::prePaddingSeconds() const { return m_prePaddingSeconds; }
void LiveTvOptions::setPrePaddingSeconds(qint32 newPrePaddingSeconds) {
m_prePaddingSeconds = newPrePaddingSeconds;
}
qint32 LiveTvOptions::postPaddingSeconds() const { return m_postPaddingSeconds; }
void LiveTvOptions::setPostPaddingSeconds(qint32 newPostPaddingSeconds) {
m_postPaddingSeconds = newPostPaddingSeconds;
}
QStringList LiveTvOptions::mediaLocationsCreated() const { return m_mediaLocationsCreated; }
void LiveTvOptions::setMediaLocationsCreated(QStringList newMediaLocationsCreated) {
m_mediaLocationsCreated = newMediaLocationsCreated;
}
bool LiveTvOptions::mediaLocationsCreatedNull() const {
return m_mediaLocationsCreated.size() == 0;
}
void LiveTvOptions::setMediaLocationsCreatedNull() {
m_mediaLocationsCreated.clear();
}
QString LiveTvOptions::recordingPostProcessor() const { return m_recordingPostProcessor; }
void LiveTvOptions::setRecordingPostProcessor(QString newRecordingPostProcessor) {
m_recordingPostProcessor = newRecordingPostProcessor;
}
bool LiveTvOptions::recordingPostProcessorNull() const {
return m_recordingPostProcessor.isNull();
}
void LiveTvOptions::setRecordingPostProcessorNull() {
m_recordingPostProcessor.clear();
}
QString LiveTvOptions::recordingPostProcessorArguments() const { return m_recordingPostProcessorArguments; }
void LiveTvOptions::setRecordingPostProcessorArguments(QString newRecordingPostProcessorArguments) {
m_recordingPostProcessorArguments = newRecordingPostProcessorArguments;
}
bool LiveTvOptions::recordingPostProcessorArgumentsNull() const {
return m_recordingPostProcessorArguments.isNull();
}
void LiveTvOptions::setRecordingPostProcessorArgumentsNull() {
m_recordingPostProcessorArguments.clear();
}
bool LiveTvOptions::saveRecordingNFO() const { return m_saveRecordingNFO; }
void LiveTvOptions::setSaveRecordingNFO(bool newSaveRecordingNFO) {
m_saveRecordingNFO = newSaveRecordingNFO;
}
bool LiveTvOptions::saveRecordingImages() const { return m_saveRecordingImages; }
void LiveTvOptions::setSaveRecordingImages(bool newSaveRecordingImages) {
m_saveRecordingImages = newSaveRecordingImages;
}
} // NS DTO
namespace Support {
using LiveTvOptions = Jellyfin::DTO::LiveTvOptions;
template <>
LiveTvOptions fromJsonValue(const QJsonValue &source, convertType<LiveTvOptions>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return LiveTvOptions::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const LiveTvOptions &source, convertType<LiveTvOptions>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -36,11 +36,13 @@ LogFile::LogFile() {}
LogFile::LogFile (
QDateTime dateCreated,
QDateTime dateModified,
qint64 size
qint64 size,
QString name
) :
m_dateCreated(dateCreated),
m_dateModified(dateModified),
m_size(size) { }
m_size(size),
m_name(name) { }
@ -80,11 +82,7 @@ QJsonObject LogFile::toJson() const {
result["DateCreated"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateCreated);
result["DateModified"] = Jellyfin::Support::toJsonValue<QDateTime>(m_dateModified);
result["Size"] = Jellyfin::Support::toJsonValue<qint64>(m_size);
if (!(m_name.isNull())) {
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
}
result["Name"] = Jellyfin::Support::toJsonValue<QString>(m_name);
return result;
}
@ -111,14 +109,7 @@ QString LogFile::name() const { return m_name; }
void LogFile::setName(QString newName) {
m_name = newName;
}
bool LogFile::nameNull() const {
return m_name.isNull();
}
void LogFile::setNameNull() {
m_name.clear();
}
} // NS DTO

108
core/src/dto/lyricdto.cpp Normal file
View file

@ -0,0 +1,108 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/lyricdto.h>
namespace Jellyfin {
namespace DTO {
LyricDto::LyricDto() {}
LyricDto::LyricDto (
QSharedPointer<LyricMetadata> metadata,
QList<LyricLine> lyrics
) :
m_metadata(metadata),
m_lyrics(lyrics) { }
LyricDto::LyricDto(const LyricDto &other) :
m_metadata(other.m_metadata),
m_lyrics(other.m_lyrics){}
void LyricDto::replaceData(LyricDto &other) {
m_metadata = other.m_metadata;
m_lyrics = other.m_lyrics;
}
LyricDto LyricDto::fromJson(QJsonObject source) {
LyricDto instance;
instance.setFromJson(source);
return instance;
}
void LyricDto::setFromJson(QJsonObject source) {
m_metadata = Jellyfin::Support::fromJsonValue<QSharedPointer<LyricMetadata>>(source["Metadata"]);
m_lyrics = Jellyfin::Support::fromJsonValue<QList<LyricLine>>(source["Lyrics"]);
}
QJsonObject LyricDto::toJson() const {
QJsonObject result;
result["Metadata"] = Jellyfin::Support::toJsonValue<QSharedPointer<LyricMetadata>>(m_metadata);
result["Lyrics"] = Jellyfin::Support::toJsonValue<QList<LyricLine>>(m_lyrics);
return result;
}
QSharedPointer<LyricMetadata> LyricDto::metadata() const { return m_metadata; }
void LyricDto::setMetadata(QSharedPointer<LyricMetadata> newMetadata) {
m_metadata = newMetadata;
}
QList<LyricLine> LyricDto::lyrics() const { return m_lyrics; }
void LyricDto::setLyrics(QList<LyricLine> newLyrics) {
m_lyrics = newLyrics;
}
} // NS DTO
namespace Support {
using LyricDto = Jellyfin::DTO::LyricDto;
template <>
LyricDto fromJsonValue(const QJsonValue &source, convertType<LyricDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return LyricDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const LyricDto &source, convertType<LyricDto>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

117
core/src/dto/lyricline.cpp Normal file
View file

@ -0,0 +1,117 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/lyricline.h>
namespace Jellyfin {
namespace DTO {
LyricLine::LyricLine() {}
LyricLine::LyricLine (
QString text
) :
m_text(text) { }
LyricLine::LyricLine(const LyricLine &other) :
m_text(other.m_text),
m_start(other.m_start){}
void LyricLine::replaceData(LyricLine &other) {
m_text = other.m_text;
m_start = other.m_start;
}
LyricLine LyricLine::fromJson(QJsonObject source) {
LyricLine instance;
instance.setFromJson(source);
return instance;
}
void LyricLine::setFromJson(QJsonObject source) {
m_text = Jellyfin::Support::fromJsonValue<QString>(source["Text"]);
m_start = Jellyfin::Support::fromJsonValue<std::optional<qint64>>(source["Start"]);
}
QJsonObject LyricLine::toJson() const {
QJsonObject result;
result["Text"] = Jellyfin::Support::toJsonValue<QString>(m_text);
if (!(!m_start.has_value())) {
result["Start"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_start);
}
return result;
}
QString LyricLine::text() const { return m_text; }
void LyricLine::setText(QString newText) {
m_text = newText;
}
std::optional<qint64> LyricLine::start() const { return m_start; }
void LyricLine::setStart(std::optional<qint64> newStart) {
m_start = newStart;
}
bool LyricLine::startNull() const {
return !m_start.has_value();
}
void LyricLine::setStartNull() {
m_start = std::nullopt;
}
} // NS DTO
namespace Support {
using LyricLine = Jellyfin::DTO::LyricLine;
template <>
LyricLine fromJsonValue(const QJsonValue &source, convertType<LyricLine>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return LyricLine::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const LyricLine &source, convertType<LyricLine>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,290 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/lyricmetadata.h>
namespace Jellyfin {
namespace DTO {
LyricMetadata::LyricMetadata() {}
LyricMetadata::LyricMetadata(const LyricMetadata &other) :
m_artist(other.m_artist),
m_album(other.m_album),
m_title(other.m_title),
m_author(other.m_author),
m_length(other.m_length),
m_by(other.m_by),
m_offset(other.m_offset),
m_creator(other.m_creator),
m_version(other.m_version),
m_isSynced(other.m_isSynced){}
void LyricMetadata::replaceData(LyricMetadata &other) {
m_artist = other.m_artist;
m_album = other.m_album;
m_title = other.m_title;
m_author = other.m_author;
m_length = other.m_length;
m_by = other.m_by;
m_offset = other.m_offset;
m_creator = other.m_creator;
m_version = other.m_version;
m_isSynced = other.m_isSynced;
}
LyricMetadata LyricMetadata::fromJson(QJsonObject source) {
LyricMetadata instance;
instance.setFromJson(source);
return instance;
}
void LyricMetadata::setFromJson(QJsonObject source) {
m_artist = Jellyfin::Support::fromJsonValue<QString>(source["Artist"]);
m_album = Jellyfin::Support::fromJsonValue<QString>(source["Album"]);
m_title = Jellyfin::Support::fromJsonValue<QString>(source["Title"]);
m_author = Jellyfin::Support::fromJsonValue<QString>(source["Author"]);
m_length = Jellyfin::Support::fromJsonValue<std::optional<qint64>>(source["Length"]);
m_by = Jellyfin::Support::fromJsonValue<QString>(source["By"]);
m_offset = Jellyfin::Support::fromJsonValue<std::optional<qint64>>(source["Offset"]);
m_creator = Jellyfin::Support::fromJsonValue<QString>(source["Creator"]);
m_version = Jellyfin::Support::fromJsonValue<QString>(source["Version"]);
m_isSynced = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["IsSynced"]);
}
QJsonObject LyricMetadata::toJson() const {
QJsonObject result;
if (!(m_artist.isNull())) {
result["Artist"] = Jellyfin::Support::toJsonValue<QString>(m_artist);
}
if (!(m_album.isNull())) {
result["Album"] = Jellyfin::Support::toJsonValue<QString>(m_album);
}
if (!(m_title.isNull())) {
result["Title"] = Jellyfin::Support::toJsonValue<QString>(m_title);
}
if (!(m_author.isNull())) {
result["Author"] = Jellyfin::Support::toJsonValue<QString>(m_author);
}
if (!(!m_length.has_value())) {
result["Length"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_length);
}
if (!(m_by.isNull())) {
result["By"] = Jellyfin::Support::toJsonValue<QString>(m_by);
}
if (!(!m_offset.has_value())) {
result["Offset"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_offset);
}
if (!(m_creator.isNull())) {
result["Creator"] = Jellyfin::Support::toJsonValue<QString>(m_creator);
}
if (!(m_version.isNull())) {
result["Version"] = Jellyfin::Support::toJsonValue<QString>(m_version);
}
if (!(!m_isSynced.has_value())) {
result["IsSynced"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_isSynced);
}
return result;
}
QString LyricMetadata::artist() const { return m_artist; }
void LyricMetadata::setArtist(QString newArtist) {
m_artist = newArtist;
}
bool LyricMetadata::artistNull() const {
return m_artist.isNull();
}
void LyricMetadata::setArtistNull() {
m_artist.clear();
}
QString LyricMetadata::album() const { return m_album; }
void LyricMetadata::setAlbum(QString newAlbum) {
m_album = newAlbum;
}
bool LyricMetadata::albumNull() const {
return m_album.isNull();
}
void LyricMetadata::setAlbumNull() {
m_album.clear();
}
QString LyricMetadata::title() const { return m_title; }
void LyricMetadata::setTitle(QString newTitle) {
m_title = newTitle;
}
bool LyricMetadata::titleNull() const {
return m_title.isNull();
}
void LyricMetadata::setTitleNull() {
m_title.clear();
}
QString LyricMetadata::author() const { return m_author; }
void LyricMetadata::setAuthor(QString newAuthor) {
m_author = newAuthor;
}
bool LyricMetadata::authorNull() const {
return m_author.isNull();
}
void LyricMetadata::setAuthorNull() {
m_author.clear();
}
std::optional<qint64> LyricMetadata::length() const { return m_length; }
void LyricMetadata::setLength(std::optional<qint64> newLength) {
m_length = newLength;
}
bool LyricMetadata::lengthNull() const {
return !m_length.has_value();
}
void LyricMetadata::setLengthNull() {
m_length = std::nullopt;
}
QString LyricMetadata::by() const { return m_by; }
void LyricMetadata::setBy(QString newBy) {
m_by = newBy;
}
bool LyricMetadata::byNull() const {
return m_by.isNull();
}
void LyricMetadata::setByNull() {
m_by.clear();
}
std::optional<qint64> LyricMetadata::offset() const { return m_offset; }
void LyricMetadata::setOffset(std::optional<qint64> newOffset) {
m_offset = newOffset;
}
bool LyricMetadata::offsetNull() const {
return !m_offset.has_value();
}
void LyricMetadata::setOffsetNull() {
m_offset = std::nullopt;
}
QString LyricMetadata::creator() const { return m_creator; }
void LyricMetadata::setCreator(QString newCreator) {
m_creator = newCreator;
}
bool LyricMetadata::creatorNull() const {
return m_creator.isNull();
}
void LyricMetadata::setCreatorNull() {
m_creator.clear();
}
QString LyricMetadata::version() const { return m_version; }
void LyricMetadata::setVersion(QString newVersion) {
m_version = newVersion;
}
bool LyricMetadata::versionNull() const {
return m_version.isNull();
}
void LyricMetadata::setVersionNull() {
m_version.clear();
}
std::optional<bool> LyricMetadata::isSynced() const { return m_isSynced; }
void LyricMetadata::setIsSynced(std::optional<bool> newIsSynced) {
m_isSynced = newIsSynced;
}
bool LyricMetadata::isSyncedNull() const {
return !m_isSynced.has_value();
}
void LyricMetadata::setIsSyncedNull() {
m_isSynced = std::nullopt;
}
} // NS DTO
namespace Support {
using LyricMetadata = Jellyfin::DTO::LyricMetadata;
template <>
LyricMetadata fromJsonValue(const QJsonValue &source, convertType<LyricMetadata>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return LyricMetadata::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const LyricMetadata &source, convertType<LyricMetadata>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -33,16 +33,20 @@ namespace Jellyfin {
namespace DTO {
MediaPathInfo::MediaPathInfo() {}
MediaPathInfo::MediaPathInfo (
QString path
) :
m_path(path) { }
MediaPathInfo::MediaPathInfo(const MediaPathInfo &other) :
m_path(other.m_path),
m_networkPath(other.m_networkPath){}
m_path(other.m_path){}
void MediaPathInfo::replaceData(MediaPathInfo &other) {
m_path = other.m_path;
m_networkPath = other.m_networkPath;
}
MediaPathInfo MediaPathInfo::fromJson(QJsonObject source) {
@ -54,23 +58,13 @@ MediaPathInfo MediaPathInfo::fromJson(QJsonObject source) {
void MediaPathInfo::setFromJson(QJsonObject source) {
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_networkPath = Jellyfin::Support::fromJsonValue<QString>(source["NetworkPath"]);
}
QJsonObject MediaPathInfo::toJson() const {
QJsonObject result;
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_networkPath.isNull())) {
result["NetworkPath"] = Jellyfin::Support::toJsonValue<QString>(m_networkPath);
}
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
return result;
}
@ -79,27 +73,7 @@ QString MediaPathInfo::path() const { return m_path; }
void MediaPathInfo::setPath(QString newPath) {
m_path = newPath;
}
bool MediaPathInfo::pathNull() const {
return m_path.isNull();
}
void MediaPathInfo::setPathNull() {
m_path.clear();
}
QString MediaPathInfo::networkPath() const { return m_networkPath; }
void MediaPathInfo::setNetworkPath(QString newNetworkPath) {
m_networkPath = newNetworkPath;
}
bool MediaPathInfo::networkPathNull() const {
return m_networkPath.isNull();
}
void MediaPathInfo::setNetworkPathNull() {
m_networkPath.clear();
}
} // NS DTO

View file

@ -0,0 +1,144 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/mediasegmentdto.h>
namespace Jellyfin {
namespace DTO {
MediaSegmentDto::MediaSegmentDto() {}
MediaSegmentDto::MediaSegmentDto (
QString jellyfinId,
QString itemId,
MediaSegmentType type,
qint64 startTicks,
qint64 endTicks
) :
m_jellyfinId(jellyfinId),
m_itemId(itemId),
m_type(type),
m_startTicks(startTicks),
m_endTicks(endTicks) { }
MediaSegmentDto::MediaSegmentDto(const MediaSegmentDto &other) :
m_jellyfinId(other.m_jellyfinId),
m_itemId(other.m_itemId),
m_type(other.m_type),
m_startTicks(other.m_startTicks),
m_endTicks(other.m_endTicks){}
void MediaSegmentDto::replaceData(MediaSegmentDto &other) {
m_jellyfinId = other.m_jellyfinId;
m_itemId = other.m_itemId;
m_type = other.m_type;
m_startTicks = other.m_startTicks;
m_endTicks = other.m_endTicks;
}
MediaSegmentDto MediaSegmentDto::fromJson(QJsonObject source) {
MediaSegmentDto instance;
instance.setFromJson(source);
return instance;
}
void MediaSegmentDto::setFromJson(QJsonObject source) {
m_jellyfinId = Jellyfin::Support::fromJsonValue<QString>(source["Id"]);
m_itemId = Jellyfin::Support::fromJsonValue<QString>(source["ItemId"]);
m_type = Jellyfin::Support::fromJsonValue<MediaSegmentType>(source["Type"]);
m_startTicks = Jellyfin::Support::fromJsonValue<qint64>(source["StartTicks"]);
m_endTicks = Jellyfin::Support::fromJsonValue<qint64>(source["EndTicks"]);
}
QJsonObject MediaSegmentDto::toJson() const {
QJsonObject result;
result["Id"] = Jellyfin::Support::toJsonValue<QString>(m_jellyfinId);
result["ItemId"] = Jellyfin::Support::toJsonValue<QString>(m_itemId);
result["Type"] = Jellyfin::Support::toJsonValue<MediaSegmentType>(m_type);
result["StartTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_startTicks);
result["EndTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_endTicks);
return result;
}
QString MediaSegmentDto::jellyfinId() const { return m_jellyfinId; }
void MediaSegmentDto::setJellyfinId(QString newJellyfinId) {
m_jellyfinId = newJellyfinId;
}
QString MediaSegmentDto::itemId() const { return m_itemId; }
void MediaSegmentDto::setItemId(QString newItemId) {
m_itemId = newItemId;
}
MediaSegmentType MediaSegmentDto::type() const { return m_type; }
void MediaSegmentDto::setType(MediaSegmentType newType) {
m_type = newType;
}
qint64 MediaSegmentDto::startTicks() const { return m_startTicks; }
void MediaSegmentDto::setStartTicks(qint64 newStartTicks) {
m_startTicks = newStartTicks;
}
qint64 MediaSegmentDto::endTicks() const { return m_endTicks; }
void MediaSegmentDto::setEndTicks(qint64 newEndTicks) {
m_endTicks = newEndTicks;
}
} // NS DTO
namespace Support {
using MediaSegmentDto = Jellyfin::DTO::MediaSegmentDto;
template <>
MediaSegmentDto fromJsonValue(const QJsonValue &source, convertType<MediaSegmentDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return MediaSegmentDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const MediaSegmentDto &source, convertType<MediaSegmentDto>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,120 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/mediasegmentdtoqueryresult.h>
namespace Jellyfin {
namespace DTO {
MediaSegmentDtoQueryResult::MediaSegmentDtoQueryResult() {}
MediaSegmentDtoQueryResult::MediaSegmentDtoQueryResult (
QList<MediaSegmentDto> items,
qint32 totalRecordCount,
qint32 startIndex
) :
m_items(items),
m_totalRecordCount(totalRecordCount),
m_startIndex(startIndex) { }
MediaSegmentDtoQueryResult::MediaSegmentDtoQueryResult(const MediaSegmentDtoQueryResult &other) :
m_items(other.m_items),
m_totalRecordCount(other.m_totalRecordCount),
m_startIndex(other.m_startIndex){}
void MediaSegmentDtoQueryResult::replaceData(MediaSegmentDtoQueryResult &other) {
m_items = other.m_items;
m_totalRecordCount = other.m_totalRecordCount;
m_startIndex = other.m_startIndex;
}
MediaSegmentDtoQueryResult MediaSegmentDtoQueryResult::fromJson(QJsonObject source) {
MediaSegmentDtoQueryResult instance;
instance.setFromJson(source);
return instance;
}
void MediaSegmentDtoQueryResult::setFromJson(QJsonObject source) {
m_items = Jellyfin::Support::fromJsonValue<QList<MediaSegmentDto>>(source["Items"]);
m_totalRecordCount = Jellyfin::Support::fromJsonValue<qint32>(source["TotalRecordCount"]);
m_startIndex = Jellyfin::Support::fromJsonValue<qint32>(source["StartIndex"]);
}
QJsonObject MediaSegmentDtoQueryResult::toJson() const {
QJsonObject result;
result["Items"] = Jellyfin::Support::toJsonValue<QList<MediaSegmentDto>>(m_items);
result["TotalRecordCount"] = Jellyfin::Support::toJsonValue<qint32>(m_totalRecordCount);
result["StartIndex"] = Jellyfin::Support::toJsonValue<qint32>(m_startIndex);
return result;
}
QList<MediaSegmentDto> MediaSegmentDtoQueryResult::items() const { return m_items; }
void MediaSegmentDtoQueryResult::setItems(QList<MediaSegmentDto> newItems) {
m_items = newItems;
}
qint32 MediaSegmentDtoQueryResult::totalRecordCount() const { return m_totalRecordCount; }
void MediaSegmentDtoQueryResult::setTotalRecordCount(qint32 newTotalRecordCount) {
m_totalRecordCount = newTotalRecordCount;
}
qint32 MediaSegmentDtoQueryResult::startIndex() const { return m_startIndex; }
void MediaSegmentDtoQueryResult::setStartIndex(qint32 newStartIndex) {
m_startIndex = newStartIndex;
}
} // NS DTO
namespace Support {
using MediaSegmentDtoQueryResult = Jellyfin::DTO::MediaSegmentDtoQueryResult;
template <>
MediaSegmentDtoQueryResult fromJsonValue(const QJsonValue &source, convertType<MediaSegmentDtoQueryResult>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return MediaSegmentDtoQueryResult::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const MediaSegmentDtoQueryResult &source, convertType<MediaSegmentDtoQueryResult>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,93 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/mediasegmenttype.h>
namespace Jellyfin {
namespace DTO {
MediaSegmentTypeClass::MediaSegmentTypeClass() {}
} // NS DTO
namespace Support {
using MediaSegmentType = Jellyfin::DTO::MediaSegmentType;
template <>
MediaSegmentType fromJsonValue(const QJsonValue &source, convertType<MediaSegmentType>) {
if (!source.isString()) return MediaSegmentType::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Unknown")) {
return MediaSegmentType::Unknown;
}
if (str == QStringLiteral("Commercial")) {
return MediaSegmentType::Commercial;
}
if (str == QStringLiteral("Preview")) {
return MediaSegmentType::Preview;
}
if (str == QStringLiteral("Recap")) {
return MediaSegmentType::Recap;
}
if (str == QStringLiteral("Outro")) {
return MediaSegmentType::Outro;
}
if (str == QStringLiteral("Intro")) {
return MediaSegmentType::Intro;
}
return MediaSegmentType::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const MediaSegmentType &source, convertType<MediaSegmentType>) {
switch(source) {
case MediaSegmentType::Unknown:
return QStringLiteral("Unknown");
case MediaSegmentType::Commercial:
return QStringLiteral("Commercial");
case MediaSegmentType::Preview:
return QStringLiteral("Preview");
case MediaSegmentType::Recap:
return QStringLiteral("Recap");
case MediaSegmentType::Outro:
return QStringLiteral("Outro");
case MediaSegmentType::Intro:
return QStringLiteral("Intro");
case MediaSegmentType::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -46,6 +46,7 @@ MediaSourceInfo::MediaSourceInfo (
bool supportsDirectStream,
bool supportsDirectPlay,
bool isInfiniteStream,
std::optional<bool> useMostCompatibleTranscodingProfile,
bool requiresOpening,
bool requiresClosing,
bool requiresLooping,
@ -53,7 +54,9 @@ MediaSourceInfo::MediaSourceInfo (
VideoType videoType,
IsoType isoType,
Video3DFormat video3DFormat,
TransportStreamTimestamp timestamp
TransportStreamTimestamp timestamp,
MediaStreamProtocol transcodingSubProtocol,
bool hasSegments
) :
m_protocol(protocol),
m_encoderProtocol(encoderProtocol),
@ -67,6 +70,7 @@ MediaSourceInfo::MediaSourceInfo (
m_supportsDirectStream(supportsDirectStream),
m_supportsDirectPlay(supportsDirectPlay),
m_isInfiniteStream(isInfiniteStream),
m_useMostCompatibleTranscodingProfile(useMostCompatibleTranscodingProfile),
m_requiresOpening(requiresOpening),
m_requiresClosing(requiresClosing),
m_requiresLooping(requiresLooping),
@ -74,7 +78,9 @@ MediaSourceInfo::MediaSourceInfo (
m_videoType(videoType),
m_isoType(isoType),
m_video3DFormat(video3DFormat),
m_timestamp(timestamp) { }
m_timestamp(timestamp),
m_transcodingSubProtocol(transcodingSubProtocol),
m_hasSegments(hasSegments) { }
@ -100,6 +106,7 @@ MediaSourceInfo::MediaSourceInfo(const MediaSourceInfo &other) :
m_supportsDirectStream(other.m_supportsDirectStream),
m_supportsDirectPlay(other.m_supportsDirectPlay),
m_isInfiniteStream(other.m_isInfiniteStream),
m_useMostCompatibleTranscodingProfile(other.m_useMostCompatibleTranscodingProfile),
m_requiresOpening(other.m_requiresOpening),
m_openToken(other.m_openToken),
m_requiresClosing(other.m_requiresClosing),
@ -114,6 +121,7 @@ MediaSourceInfo::MediaSourceInfo(const MediaSourceInfo &other) :
m_mediaAttachments(other.m_mediaAttachments),
m_formats(other.m_formats),
m_bitrate(other.m_bitrate),
m_fallbackMaxStreamingBitrate(other.m_fallbackMaxStreamingBitrate),
m_timestamp(other.m_timestamp),
m_requiredHttpHeaders(other.m_requiredHttpHeaders),
m_transcodingUrl(other.m_transcodingUrl),
@ -121,7 +129,8 @@ MediaSourceInfo::MediaSourceInfo(const MediaSourceInfo &other) :
m_transcodingContainer(other.m_transcodingContainer),
m_analyzeDurationMs(other.m_analyzeDurationMs),
m_defaultAudioStreamIndex(other.m_defaultAudioStreamIndex),
m_defaultSubtitleStreamIndex(other.m_defaultSubtitleStreamIndex){}
m_defaultSubtitleStreamIndex(other.m_defaultSubtitleStreamIndex),
m_hasSegments(other.m_hasSegments){}
void MediaSourceInfo::replaceData(MediaSourceInfo &other) {
@ -145,6 +154,7 @@ void MediaSourceInfo::replaceData(MediaSourceInfo &other) {
m_supportsDirectStream = other.m_supportsDirectStream;
m_supportsDirectPlay = other.m_supportsDirectPlay;
m_isInfiniteStream = other.m_isInfiniteStream;
m_useMostCompatibleTranscodingProfile = other.m_useMostCompatibleTranscodingProfile;
m_requiresOpening = other.m_requiresOpening;
m_openToken = other.m_openToken;
m_requiresClosing = other.m_requiresClosing;
@ -159,6 +169,7 @@ void MediaSourceInfo::replaceData(MediaSourceInfo &other) {
m_mediaAttachments = other.m_mediaAttachments;
m_formats = other.m_formats;
m_bitrate = other.m_bitrate;
m_fallbackMaxStreamingBitrate = other.m_fallbackMaxStreamingBitrate;
m_timestamp = other.m_timestamp;
m_requiredHttpHeaders = other.m_requiredHttpHeaders;
m_transcodingUrl = other.m_transcodingUrl;
@ -167,6 +178,7 @@ void MediaSourceInfo::replaceData(MediaSourceInfo &other) {
m_analyzeDurationMs = other.m_analyzeDurationMs;
m_defaultAudioStreamIndex = other.m_defaultAudioStreamIndex;
m_defaultSubtitleStreamIndex = other.m_defaultSubtitleStreamIndex;
m_hasSegments = other.m_hasSegments;
}
MediaSourceInfo MediaSourceInfo::fromJson(QJsonObject source) {
@ -197,6 +209,7 @@ void MediaSourceInfo::setFromJson(QJsonObject source) {
m_supportsDirectStream = Jellyfin::Support::fromJsonValue<bool>(source["SupportsDirectStream"]);
m_supportsDirectPlay = Jellyfin::Support::fromJsonValue<bool>(source["SupportsDirectPlay"]);
m_isInfiniteStream = Jellyfin::Support::fromJsonValue<bool>(source["IsInfiniteStream"]);
m_useMostCompatibleTranscodingProfile = Jellyfin::Support::fromJsonValue<std::optional<bool>>(source["UseMostCompatibleTranscodingProfile"]);
m_requiresOpening = Jellyfin::Support::fromJsonValue<bool>(source["RequiresOpening"]);
m_openToken = Jellyfin::Support::fromJsonValue<QString>(source["OpenToken"]);
m_requiresClosing = Jellyfin::Support::fromJsonValue<bool>(source["RequiresClosing"]);
@ -211,14 +224,16 @@ void MediaSourceInfo::setFromJson(QJsonObject source) {
m_mediaAttachments = Jellyfin::Support::fromJsonValue<QList<MediaAttachment>>(source["MediaAttachments"]);
m_formats = Jellyfin::Support::fromJsonValue<QStringList>(source["Formats"]);
m_bitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["Bitrate"]);
m_fallbackMaxStreamingBitrate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["FallbackMaxStreamingBitrate"]);
m_timestamp = Jellyfin::Support::fromJsonValue<TransportStreamTimestamp>(source["Timestamp"]);
m_requiredHttpHeaders = Jellyfin::Support::fromJsonValue<QJsonObject>(source["RequiredHttpHeaders"]);
m_transcodingUrl = Jellyfin::Support::fromJsonValue<QString>(source["TranscodingUrl"]);
m_transcodingSubProtocol = Jellyfin::Support::fromJsonValue<QString>(source["TranscodingSubProtocol"]);
m_transcodingSubProtocol = Jellyfin::Support::fromJsonValue<MediaStreamProtocol>(source["TranscodingSubProtocol"]);
m_transcodingContainer = Jellyfin::Support::fromJsonValue<QString>(source["TranscodingContainer"]);
m_analyzeDurationMs = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["AnalyzeDurationMs"]);
m_defaultAudioStreamIndex = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DefaultAudioStreamIndex"]);
m_defaultSubtitleStreamIndex = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DefaultSubtitleStreamIndex"]);
m_hasSegments = Jellyfin::Support::fromJsonValue<bool>(source["HasSegments"]);
}
@ -277,6 +292,7 @@ QJsonObject MediaSourceInfo::toJson() const {
result["SupportsDirectStream"] = Jellyfin::Support::toJsonValue<bool>(m_supportsDirectStream);
result["SupportsDirectPlay"] = Jellyfin::Support::toJsonValue<bool>(m_supportsDirectPlay);
result["IsInfiniteStream"] = Jellyfin::Support::toJsonValue<bool>(m_isInfiniteStream);
result["UseMostCompatibleTranscodingProfile"] = Jellyfin::Support::toJsonValue<std::optional<bool>>(m_useMostCompatibleTranscodingProfile);
result["RequiresOpening"] = Jellyfin::Support::toJsonValue<bool>(m_requiresOpening);
if (!(m_openToken.isNull())) {
@ -319,6 +335,11 @@ QJsonObject MediaSourceInfo::toJson() const {
result["Bitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_bitrate);
}
if (!(!m_fallbackMaxStreamingBitrate.has_value())) {
result["FallbackMaxStreamingBitrate"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_fallbackMaxStreamingBitrate);
}
result["Timestamp"] = Jellyfin::Support::toJsonValue<TransportStreamTimestamp>(m_timestamp);
if (!(m_requiredHttpHeaders.isEmpty())) {
@ -330,11 +351,7 @@ QJsonObject MediaSourceInfo::toJson() const {
result["TranscodingUrl"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingUrl);
}
if (!(m_transcodingSubProtocol.isNull())) {
result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingSubProtocol);
}
result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue<MediaStreamProtocol>(m_transcodingSubProtocol);
if (!(m_transcodingContainer.isNull())) {
result["TranscodingContainer"] = Jellyfin::Support::toJsonValue<QString>(m_transcodingContainer);
@ -354,7 +371,8 @@ QJsonObject MediaSourceInfo::toJson() const {
if (!(!m_defaultSubtitleStreamIndex.has_value())) {
result["DefaultSubtitleStreamIndex"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_defaultSubtitleStreamIndex);
}
result["HasSegments"] = Jellyfin::Support::toJsonValue<bool>(m_hasSegments);
return result;
}
@ -534,6 +552,12 @@ void MediaSourceInfo::setIsInfiniteStream(bool newIsInfiniteStream) {
m_isInfiniteStream = newIsInfiniteStream;
}
std::optional<bool> MediaSourceInfo::useMostCompatibleTranscodingProfile() const { return m_useMostCompatibleTranscodingProfile; }
void MediaSourceInfo::setUseMostCompatibleTranscodingProfile(std::optional<bool> newUseMostCompatibleTranscodingProfile) {
m_useMostCompatibleTranscodingProfile = newUseMostCompatibleTranscodingProfile;
}
bool MediaSourceInfo::requiresOpening() const { return m_requiresOpening; }
void MediaSourceInfo::setRequiresOpening(bool newRequiresOpening) {
@ -666,6 +690,19 @@ bool MediaSourceInfo::bitrateNull() const {
void MediaSourceInfo::setBitrateNull() {
m_bitrate = std::nullopt;
}
std::optional<qint32> MediaSourceInfo::fallbackMaxStreamingBitrate() const { return m_fallbackMaxStreamingBitrate; }
void MediaSourceInfo::setFallbackMaxStreamingBitrate(std::optional<qint32> newFallbackMaxStreamingBitrate) {
m_fallbackMaxStreamingBitrate = newFallbackMaxStreamingBitrate;
}
bool MediaSourceInfo::fallbackMaxStreamingBitrateNull() const {
return !m_fallbackMaxStreamingBitrate.has_value();
}
void MediaSourceInfo::setFallbackMaxStreamingBitrateNull() {
m_fallbackMaxStreamingBitrate = std::nullopt;
}
TransportStreamTimestamp MediaSourceInfo::timestamp() const { return m_timestamp; }
@ -699,19 +736,12 @@ void MediaSourceInfo::setTranscodingUrlNull() {
m_transcodingUrl.clear();
}
QString MediaSourceInfo::transcodingSubProtocol() const { return m_transcodingSubProtocol; }
MediaStreamProtocol MediaSourceInfo::transcodingSubProtocol() const { return m_transcodingSubProtocol; }
void MediaSourceInfo::setTranscodingSubProtocol(QString newTranscodingSubProtocol) {
void MediaSourceInfo::setTranscodingSubProtocol(MediaStreamProtocol newTranscodingSubProtocol) {
m_transcodingSubProtocol = newTranscodingSubProtocol;
}
bool MediaSourceInfo::transcodingSubProtocolNull() const {
return m_transcodingSubProtocol.isNull();
}
void MediaSourceInfo::setTranscodingSubProtocolNull() {
m_transcodingSubProtocol.clear();
}
QString MediaSourceInfo::transcodingContainer() const { return m_transcodingContainer; }
void MediaSourceInfo::setTranscodingContainer(QString newTranscodingContainer) {
@ -764,6 +794,12 @@ void MediaSourceInfo::setDefaultSubtitleStreamIndexNull() {
m_defaultSubtitleStreamIndex = std::nullopt;
}
bool MediaSourceInfo::hasSegments() const { return m_hasSegments; }
void MediaSourceInfo::setHasSegments(bool newHasSegments) {
m_hasSegments = newHasSegments;
}
} // NS DTO

View file

@ -34,9 +34,13 @@ namespace DTO {
MediaStream::MediaStream() {}
MediaStream::MediaStream (
VideoRange videoRange,
VideoRangeType videoRangeType,
AudioSpatialFormat audioSpatialFormat,
bool isInterlaced,
bool isDefault,
bool isForced,
bool isHearingImpaired,
MediaStreamType type,
qint32 index,
bool isExternal,
@ -44,9 +48,13 @@ MediaStream::MediaStream (
bool isTextSubtitleStream,
bool supportsExternalStream
) :
m_videoRange(videoRange),
m_videoRangeType(videoRangeType),
m_audioSpatialFormat(audioSpatialFormat),
m_isInterlaced(isInterlaced),
m_isDefault(isDefault),
m_isForced(isForced),
m_isHearingImpaired(isHearingImpaired),
m_type(type),
m_index(index),
m_isExternal(isExternal),
@ -65,14 +73,28 @@ MediaStream::MediaStream(const MediaStream &other) :
m_colorSpace(other.m_colorSpace),
m_colorTransfer(other.m_colorTransfer),
m_colorPrimaries(other.m_colorPrimaries),
m_dvVersionMajor(other.m_dvVersionMajor),
m_dvVersionMinor(other.m_dvVersionMinor),
m_dvProfile(other.m_dvProfile),
m_dvLevel(other.m_dvLevel),
m_rpuPresentFlag(other.m_rpuPresentFlag),
m_elPresentFlag(other.m_elPresentFlag),
m_blPresentFlag(other.m_blPresentFlag),
m_dvBlSignalCompatibilityId(other.m_dvBlSignalCompatibilityId),
m_rotation(other.m_rotation),
m_comment(other.m_comment),
m_timeBase(other.m_timeBase),
m_codecTimeBase(other.m_codecTimeBase),
m_title(other.m_title),
m_videoRange(other.m_videoRange),
m_videoRangeType(other.m_videoRangeType),
m_videoDoViTitle(other.m_videoDoViTitle),
m_audioSpatialFormat(other.m_audioSpatialFormat),
m_localizedUndefined(other.m_localizedUndefined),
m_localizedDefault(other.m_localizedDefault),
m_localizedForced(other.m_localizedForced),
m_localizedExternal(other.m_localizedExternal),
m_localizedHearingImpaired(other.m_localizedHearingImpaired),
m_displayTitle(other.m_displayTitle),
m_nalLengthSize(other.m_nalLengthSize),
m_isInterlaced(other.m_isInterlaced),
@ -86,10 +108,12 @@ MediaStream::MediaStream(const MediaStream &other) :
m_sampleRate(other.m_sampleRate),
m_isDefault(other.m_isDefault),
m_isForced(other.m_isForced),
m_isHearingImpaired(other.m_isHearingImpaired),
m_height(other.m_height),
m_width(other.m_width),
m_averageFrameRate(other.m_averageFrameRate),
m_realFrameRate(other.m_realFrameRate),
m_referenceFrameRate(other.m_referenceFrameRate),
m_profile(other.m_profile),
m_type(other.m_type),
m_aspectRatio(other.m_aspectRatio),
@ -115,14 +139,28 @@ void MediaStream::replaceData(MediaStream &other) {
m_colorSpace = other.m_colorSpace;
m_colorTransfer = other.m_colorTransfer;
m_colorPrimaries = other.m_colorPrimaries;
m_dvVersionMajor = other.m_dvVersionMajor;
m_dvVersionMinor = other.m_dvVersionMinor;
m_dvProfile = other.m_dvProfile;
m_dvLevel = other.m_dvLevel;
m_rpuPresentFlag = other.m_rpuPresentFlag;
m_elPresentFlag = other.m_elPresentFlag;
m_blPresentFlag = other.m_blPresentFlag;
m_dvBlSignalCompatibilityId = other.m_dvBlSignalCompatibilityId;
m_rotation = other.m_rotation;
m_comment = other.m_comment;
m_timeBase = other.m_timeBase;
m_codecTimeBase = other.m_codecTimeBase;
m_title = other.m_title;
m_videoRange = other.m_videoRange;
m_videoRangeType = other.m_videoRangeType;
m_videoDoViTitle = other.m_videoDoViTitle;
m_audioSpatialFormat = other.m_audioSpatialFormat;
m_localizedUndefined = other.m_localizedUndefined;
m_localizedDefault = other.m_localizedDefault;
m_localizedForced = other.m_localizedForced;
m_localizedExternal = other.m_localizedExternal;
m_localizedHearingImpaired = other.m_localizedHearingImpaired;
m_displayTitle = other.m_displayTitle;
m_nalLengthSize = other.m_nalLengthSize;
m_isInterlaced = other.m_isInterlaced;
@ -136,10 +174,12 @@ void MediaStream::replaceData(MediaStream &other) {
m_sampleRate = other.m_sampleRate;
m_isDefault = other.m_isDefault;
m_isForced = other.m_isForced;
m_isHearingImpaired = other.m_isHearingImpaired;
m_height = other.m_height;
m_width = other.m_width;
m_averageFrameRate = other.m_averageFrameRate;
m_realFrameRate = other.m_realFrameRate;
m_referenceFrameRate = other.m_referenceFrameRate;
m_profile = other.m_profile;
m_type = other.m_type;
m_aspectRatio = other.m_aspectRatio;
@ -172,14 +212,28 @@ void MediaStream::setFromJson(QJsonObject source) {
m_colorSpace = Jellyfin::Support::fromJsonValue<QString>(source["ColorSpace"]);
m_colorTransfer = Jellyfin::Support::fromJsonValue<QString>(source["ColorTransfer"]);
m_colorPrimaries = Jellyfin::Support::fromJsonValue<QString>(source["ColorPrimaries"]);
m_dvVersionMajor = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DvVersionMajor"]);
m_dvVersionMinor = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DvVersionMinor"]);
m_dvProfile = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DvProfile"]);
m_dvLevel = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DvLevel"]);
m_rpuPresentFlag = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["RpuPresentFlag"]);
m_elPresentFlag = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["ElPresentFlag"]);
m_blPresentFlag = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["BlPresentFlag"]);
m_dvBlSignalCompatibilityId = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["DvBlSignalCompatibilityId"]);
m_rotation = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["Rotation"]);
m_comment = Jellyfin::Support::fromJsonValue<QString>(source["Comment"]);
m_timeBase = Jellyfin::Support::fromJsonValue<QString>(source["TimeBase"]);
m_codecTimeBase = Jellyfin::Support::fromJsonValue<QString>(source["CodecTimeBase"]);
m_title = Jellyfin::Support::fromJsonValue<QString>(source["Title"]);
m_videoRange = Jellyfin::Support::fromJsonValue<QString>(source["VideoRange"]);
m_localizedUndefined = Jellyfin::Support::fromJsonValue<QString>(source["localizedUndefined"]);
m_localizedDefault = Jellyfin::Support::fromJsonValue<QString>(source["localizedDefault"]);
m_localizedForced = Jellyfin::Support::fromJsonValue<QString>(source["localizedForced"]);
m_videoRange = Jellyfin::Support::fromJsonValue<VideoRange>(source["VideoRange"]);
m_videoRangeType = Jellyfin::Support::fromJsonValue<VideoRangeType>(source["VideoRangeType"]);
m_videoDoViTitle = Jellyfin::Support::fromJsonValue<QString>(source["VideoDoViTitle"]);
m_audioSpatialFormat = Jellyfin::Support::fromJsonValue<AudioSpatialFormat>(source["AudioSpatialFormat"]);
m_localizedUndefined = Jellyfin::Support::fromJsonValue<QString>(source["LocalizedUndefined"]);
m_localizedDefault = Jellyfin::Support::fromJsonValue<QString>(source["LocalizedDefault"]);
m_localizedForced = Jellyfin::Support::fromJsonValue<QString>(source["LocalizedForced"]);
m_localizedExternal = Jellyfin::Support::fromJsonValue<QString>(source["LocalizedExternal"]);
m_localizedHearingImpaired = Jellyfin::Support::fromJsonValue<QString>(source["LocalizedHearingImpaired"]);
m_displayTitle = Jellyfin::Support::fromJsonValue<QString>(source["DisplayTitle"]);
m_nalLengthSize = Jellyfin::Support::fromJsonValue<QString>(source["NalLengthSize"]);
m_isInterlaced = Jellyfin::Support::fromJsonValue<bool>(source["IsInterlaced"]);
@ -193,10 +247,12 @@ void MediaStream::setFromJson(QJsonObject source) {
m_sampleRate = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["SampleRate"]);
m_isDefault = Jellyfin::Support::fromJsonValue<bool>(source["IsDefault"]);
m_isForced = Jellyfin::Support::fromJsonValue<bool>(source["IsForced"]);
m_isHearingImpaired = Jellyfin::Support::fromJsonValue<bool>(source["IsHearingImpaired"]);
m_height = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["Height"]);
m_width = Jellyfin::Support::fromJsonValue<std::optional<qint32>>(source["Width"]);
m_averageFrameRate = Jellyfin::Support::fromJsonValue<std::optional<float>>(source["AverageFrameRate"]);
m_realFrameRate = Jellyfin::Support::fromJsonValue<std::optional<float>>(source["RealFrameRate"]);
m_referenceFrameRate = Jellyfin::Support::fromJsonValue<std::optional<float>>(source["ReferenceFrameRate"]);
m_profile = Jellyfin::Support::fromJsonValue<QString>(source["Profile"]);
m_type = Jellyfin::Support::fromJsonValue<MediaStreamType>(source["Type"]);
m_aspectRatio = Jellyfin::Support::fromJsonValue<QString>(source["AspectRatio"]);
@ -254,6 +310,51 @@ QJsonObject MediaStream::toJson() const {
}
if (!(!m_dvVersionMajor.has_value())) {
result["DvVersionMajor"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_dvVersionMajor);
}
if (!(!m_dvVersionMinor.has_value())) {
result["DvVersionMinor"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_dvVersionMinor);
}
if (!(!m_dvProfile.has_value())) {
result["DvProfile"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_dvProfile);
}
if (!(!m_dvLevel.has_value())) {
result["DvLevel"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_dvLevel);
}
if (!(!m_rpuPresentFlag.has_value())) {
result["RpuPresentFlag"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_rpuPresentFlag);
}
if (!(!m_elPresentFlag.has_value())) {
result["ElPresentFlag"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_elPresentFlag);
}
if (!(!m_blPresentFlag.has_value())) {
result["BlPresentFlag"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_blPresentFlag);
}
if (!(!m_dvBlSignalCompatibilityId.has_value())) {
result["DvBlSignalCompatibilityId"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_dvBlSignalCompatibilityId);
}
if (!(!m_rotation.has_value())) {
result["Rotation"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_rotation);
}
if (!(m_comment.isNull())) {
result["Comment"] = Jellyfin::Support::toJsonValue<QString>(m_comment);
}
@ -273,24 +374,37 @@ QJsonObject MediaStream::toJson() const {
result["Title"] = Jellyfin::Support::toJsonValue<QString>(m_title);
}
result["VideoRange"] = Jellyfin::Support::toJsonValue<VideoRange>(m_videoRange);
result["VideoRangeType"] = Jellyfin::Support::toJsonValue<VideoRangeType>(m_videoRangeType);
if (!(m_videoRange.isNull())) {
result["VideoRange"] = Jellyfin::Support::toJsonValue<QString>(m_videoRange);
if (!(m_videoDoViTitle.isNull())) {
result["VideoDoViTitle"] = Jellyfin::Support::toJsonValue<QString>(m_videoDoViTitle);
}
result["AudioSpatialFormat"] = Jellyfin::Support::toJsonValue<AudioSpatialFormat>(m_audioSpatialFormat);
if (!(m_localizedUndefined.isNull())) {
result["localizedUndefined"] = Jellyfin::Support::toJsonValue<QString>(m_localizedUndefined);
result["LocalizedUndefined"] = Jellyfin::Support::toJsonValue<QString>(m_localizedUndefined);
}
if (!(m_localizedDefault.isNull())) {
result["localizedDefault"] = Jellyfin::Support::toJsonValue<QString>(m_localizedDefault);
result["LocalizedDefault"] = Jellyfin::Support::toJsonValue<QString>(m_localizedDefault);
}
if (!(m_localizedForced.isNull())) {
result["localizedForced"] = Jellyfin::Support::toJsonValue<QString>(m_localizedForced);
result["LocalizedForced"] = Jellyfin::Support::toJsonValue<QString>(m_localizedForced);
}
if (!(m_localizedExternal.isNull())) {
result["LocalizedExternal"] = Jellyfin::Support::toJsonValue<QString>(m_localizedExternal);
}
if (!(m_localizedHearingImpaired.isNull())) {
result["LocalizedHearingImpaired"] = Jellyfin::Support::toJsonValue<QString>(m_localizedHearingImpaired);
}
@ -346,6 +460,7 @@ QJsonObject MediaStream::toJson() const {
result["IsDefault"] = Jellyfin::Support::toJsonValue<bool>(m_isDefault);
result["IsForced"] = Jellyfin::Support::toJsonValue<bool>(m_isForced);
result["IsHearingImpaired"] = Jellyfin::Support::toJsonValue<bool>(m_isHearingImpaired);
if (!(!m_height.has_value())) {
result["Height"] = Jellyfin::Support::toJsonValue<std::optional<qint32>>(m_height);
@ -367,6 +482,11 @@ QJsonObject MediaStream::toJson() const {
}
if (!(!m_referenceFrameRate.has_value())) {
result["ReferenceFrameRate"] = Jellyfin::Support::toJsonValue<std::optional<float>>(m_referenceFrameRate);
}
if (!(m_profile.isNull())) {
result["Profile"] = Jellyfin::Support::toJsonValue<QString>(m_profile);
}
@ -510,6 +630,123 @@ bool MediaStream::colorPrimariesNull() const {
void MediaStream::setColorPrimariesNull() {
m_colorPrimaries.clear();
}
std::optional<qint32> MediaStream::dvVersionMajor() const { return m_dvVersionMajor; }
void MediaStream::setDvVersionMajor(std::optional<qint32> newDvVersionMajor) {
m_dvVersionMajor = newDvVersionMajor;
}
bool MediaStream::dvVersionMajorNull() const {
return !m_dvVersionMajor.has_value();
}
void MediaStream::setDvVersionMajorNull() {
m_dvVersionMajor = std::nullopt;
}
std::optional<qint32> MediaStream::dvVersionMinor() const { return m_dvVersionMinor; }
void MediaStream::setDvVersionMinor(std::optional<qint32> newDvVersionMinor) {
m_dvVersionMinor = newDvVersionMinor;
}
bool MediaStream::dvVersionMinorNull() const {
return !m_dvVersionMinor.has_value();
}
void MediaStream::setDvVersionMinorNull() {
m_dvVersionMinor = std::nullopt;
}
std::optional<qint32> MediaStream::dvProfile() const { return m_dvProfile; }
void MediaStream::setDvProfile(std::optional<qint32> newDvProfile) {
m_dvProfile = newDvProfile;
}
bool MediaStream::dvProfileNull() const {
return !m_dvProfile.has_value();
}
void MediaStream::setDvProfileNull() {
m_dvProfile = std::nullopt;
}
std::optional<qint32> MediaStream::dvLevel() const { return m_dvLevel; }
void MediaStream::setDvLevel(std::optional<qint32> newDvLevel) {
m_dvLevel = newDvLevel;
}
bool MediaStream::dvLevelNull() const {
return !m_dvLevel.has_value();
}
void MediaStream::setDvLevelNull() {
m_dvLevel = std::nullopt;
}
std::optional<qint32> MediaStream::rpuPresentFlag() const { return m_rpuPresentFlag; }
void MediaStream::setRpuPresentFlag(std::optional<qint32> newRpuPresentFlag) {
m_rpuPresentFlag = newRpuPresentFlag;
}
bool MediaStream::rpuPresentFlagNull() const {
return !m_rpuPresentFlag.has_value();
}
void MediaStream::setRpuPresentFlagNull() {
m_rpuPresentFlag = std::nullopt;
}
std::optional<qint32> MediaStream::elPresentFlag() const { return m_elPresentFlag; }
void MediaStream::setElPresentFlag(std::optional<qint32> newElPresentFlag) {
m_elPresentFlag = newElPresentFlag;
}
bool MediaStream::elPresentFlagNull() const {
return !m_elPresentFlag.has_value();
}
void MediaStream::setElPresentFlagNull() {
m_elPresentFlag = std::nullopt;
}
std::optional<qint32> MediaStream::blPresentFlag() const { return m_blPresentFlag; }
void MediaStream::setBlPresentFlag(std::optional<qint32> newBlPresentFlag) {
m_blPresentFlag = newBlPresentFlag;
}
bool MediaStream::blPresentFlagNull() const {
return !m_blPresentFlag.has_value();
}
void MediaStream::setBlPresentFlagNull() {
m_blPresentFlag = std::nullopt;
}
std::optional<qint32> MediaStream::dvBlSignalCompatibilityId() const { return m_dvBlSignalCompatibilityId; }
void MediaStream::setDvBlSignalCompatibilityId(std::optional<qint32> newDvBlSignalCompatibilityId) {
m_dvBlSignalCompatibilityId = newDvBlSignalCompatibilityId;
}
bool MediaStream::dvBlSignalCompatibilityIdNull() const {
return !m_dvBlSignalCompatibilityId.has_value();
}
void MediaStream::setDvBlSignalCompatibilityIdNull() {
m_dvBlSignalCompatibilityId = std::nullopt;
}
std::optional<qint32> MediaStream::rotation() const { return m_rotation; }
void MediaStream::setRotation(std::optional<qint32> newRotation) {
m_rotation = newRotation;
}
bool MediaStream::rotationNull() const {
return !m_rotation.has_value();
}
void MediaStream::setRotationNull() {
m_rotation = std::nullopt;
}
QString MediaStream::comment() const { return m_comment; }
@ -563,19 +800,37 @@ void MediaStream::setTitleNull() {
m_title.clear();
}
QString MediaStream::videoRange() const { return m_videoRange; }
VideoRange MediaStream::videoRange() const { return m_videoRange; }
void MediaStream::setVideoRange(QString newVideoRange) {
void MediaStream::setVideoRange(VideoRange newVideoRange) {
m_videoRange = newVideoRange;
}
bool MediaStream::videoRangeNull() const {
return m_videoRange.isNull();
VideoRangeType MediaStream::videoRangeType() const { return m_videoRangeType; }
void MediaStream::setVideoRangeType(VideoRangeType newVideoRangeType) {
m_videoRangeType = newVideoRangeType;
}
void MediaStream::setVideoRangeNull() {
m_videoRange.clear();
QString MediaStream::videoDoViTitle() const { return m_videoDoViTitle; }
void MediaStream::setVideoDoViTitle(QString newVideoDoViTitle) {
m_videoDoViTitle = newVideoDoViTitle;
}
bool MediaStream::videoDoViTitleNull() const {
return m_videoDoViTitle.isNull();
}
void MediaStream::setVideoDoViTitleNull() {
m_videoDoViTitle.clear();
}
AudioSpatialFormat MediaStream::audioSpatialFormat() const { return m_audioSpatialFormat; }
void MediaStream::setAudioSpatialFormat(AudioSpatialFormat newAudioSpatialFormat) {
m_audioSpatialFormat = newAudioSpatialFormat;
}
QString MediaStream::localizedUndefined() const { return m_localizedUndefined; }
void MediaStream::setLocalizedUndefined(QString newLocalizedUndefined) {
@ -614,6 +869,32 @@ bool MediaStream::localizedForcedNull() const {
void MediaStream::setLocalizedForcedNull() {
m_localizedForced.clear();
}
QString MediaStream::localizedExternal() const { return m_localizedExternal; }
void MediaStream::setLocalizedExternal(QString newLocalizedExternal) {
m_localizedExternal = newLocalizedExternal;
}
bool MediaStream::localizedExternalNull() const {
return m_localizedExternal.isNull();
}
void MediaStream::setLocalizedExternalNull() {
m_localizedExternal.clear();
}
QString MediaStream::localizedHearingImpaired() const { return m_localizedHearingImpaired; }
void MediaStream::setLocalizedHearingImpaired(QString newLocalizedHearingImpaired) {
m_localizedHearingImpaired = newLocalizedHearingImpaired;
}
bool MediaStream::localizedHearingImpairedNull() const {
return m_localizedHearingImpaired.isNull();
}
void MediaStream::setLocalizedHearingImpairedNull() {
m_localizedHearingImpaired.clear();
}
QString MediaStream::displayTitle() const { return m_displayTitle; }
@ -763,6 +1044,12 @@ void MediaStream::setIsForced(bool newIsForced) {
m_isForced = newIsForced;
}
bool MediaStream::isHearingImpaired() const { return m_isHearingImpaired; }
void MediaStream::setIsHearingImpaired(bool newIsHearingImpaired) {
m_isHearingImpaired = newIsHearingImpaired;
}
std::optional<qint32> MediaStream::height() const { return m_height; }
void MediaStream::setHeight(std::optional<qint32> newHeight) {
@ -814,6 +1101,19 @@ bool MediaStream::realFrameRateNull() const {
void MediaStream::setRealFrameRateNull() {
m_realFrameRate = std::nullopt;
}
std::optional<float> MediaStream::referenceFrameRate() const { return m_referenceFrameRate; }
void MediaStream::setReferenceFrameRate(std::optional<float> newReferenceFrameRate) {
m_referenceFrameRate = newReferenceFrameRate;
}
bool MediaStream::referenceFrameRateNull() const {
return !m_referenceFrameRate.has_value();
}
void MediaStream::setReferenceFrameRateNull() {
m_referenceFrameRate = std::nullopt;
}
QString MediaStream::profile() const { return m_profile; }

View file

@ -0,0 +1,73 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/mediastreamprotocol.h>
namespace Jellyfin {
namespace DTO {
MediaStreamProtocolClass::MediaStreamProtocolClass() {}
} // NS DTO
namespace Support {
using MediaStreamProtocol = Jellyfin::DTO::MediaStreamProtocol;
template <>
MediaStreamProtocol fromJsonValue(const QJsonValue &source, convertType<MediaStreamProtocol>) {
if (!source.isString()) return MediaStreamProtocol::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("http")) {
return MediaStreamProtocol::Http;
}
if (str == QStringLiteral("hls")) {
return MediaStreamProtocol::Hls;
}
return MediaStreamProtocol::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const MediaStreamProtocol &source, convertType<MediaStreamProtocol>) {
switch(source) {
case MediaStreamProtocol::Http:
return QStringLiteral("http");
case MediaStreamProtocol::Hls:
return QStringLiteral("hls");
case MediaStreamProtocol::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}
}
} // NS DTO
} // NS Jellyfin

View file

@ -57,6 +57,12 @@ MediaStreamType fromJsonValue(const QJsonValue &source, convertType<MediaStreamT
if (str == QStringLiteral("EmbeddedImage")) {
return MediaStreamType::EmbeddedImage;
}
if (str == QStringLiteral("Data")) {
return MediaStreamType::Data;
}
if (str == QStringLiteral("Lyric")) {
return MediaStreamType::Lyric;
}
return MediaStreamType::EnumNotSet;
}
@ -72,6 +78,10 @@ QJsonValue toJsonValue(const MediaStreamType &source, convertType<MediaStreamTyp
return QStringLiteral("Subtitle");
case MediaStreamType::EmbeddedImage:
return QStringLiteral("EmbeddedImage");
case MediaStreamType::Data:
return QStringLiteral("Data");
case MediaStreamType::Lyric:
return QStringLiteral("Lyric");
case MediaStreamType::EnumNotSet: // Fallthrough
default:

View file

@ -27,48 +27,58 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/quickconnectstate.h>
#include <JellyfinQt/dto/mediatype.h>
namespace Jellyfin {
namespace DTO {
QuickConnectStateClass::QuickConnectStateClass() {}
MediaTypeClass::MediaTypeClass() {}
} // NS DTO
namespace Support {
using QuickConnectState = Jellyfin::DTO::QuickConnectState;
using MediaType = Jellyfin::DTO::MediaType;
template <>
QuickConnectState fromJsonValue(const QJsonValue &source, convertType<QuickConnectState>) {
if (!source.isString()) return QuickConnectState::EnumNotSet;
MediaType fromJsonValue(const QJsonValue &source, convertType<MediaType>) {
if (!source.isString()) return MediaType::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Unavailable")) {
return QuickConnectState::Unavailable;
if (str == QStringLiteral("Unknown")) {
return MediaType::Unknown;
}
if (str == QStringLiteral("Available")) {
return QuickConnectState::Available;
if (str == QStringLiteral("Video")) {
return MediaType::Video;
}
if (str == QStringLiteral("Active")) {
return QuickConnectState::Active;
if (str == QStringLiteral("Audio")) {
return MediaType::Audio;
}
if (str == QStringLiteral("Photo")) {
return MediaType::Photo;
}
if (str == QStringLiteral("Book")) {
return MediaType::Book;
}
return QuickConnectState::EnumNotSet;
return MediaType::EnumNotSet;
}
template <>
QJsonValue toJsonValue(const QuickConnectState &source, convertType<QuickConnectState>) {
QJsonValue toJsonValue(const MediaType &source, convertType<MediaType>) {
switch(source) {
case QuickConnectState::Unavailable:
return QStringLiteral("Unavailable");
case QuickConnectState::Available:
return QStringLiteral("Available");
case QuickConnectState::Active:
return QStringLiteral("Active");
case MediaType::Unknown:
return QStringLiteral("Unknown");
case MediaType::Video:
return QStringLiteral("Video");
case MediaType::Audio:
return QStringLiteral("Audio");
case MediaType::Photo:
return QStringLiteral("Photo");
case MediaType::Book:
return QStringLiteral("Book");
case QuickConnectState::EnumNotSet: // Fallthrough
case MediaType::EnumNotSet: // Fallthrough
default:
return QJsonValue();
}

View file

@ -33,16 +33,20 @@ namespace Jellyfin {
namespace DTO {
MediaUpdateInfoDto::MediaUpdateInfoDto() {}
MediaUpdateInfoDto::MediaUpdateInfoDto (
QList<MediaUpdateInfoPathDto> updates
) :
m_updates(updates) { }
MediaUpdateInfoDto::MediaUpdateInfoDto(const MediaUpdateInfoDto &other) :
m_path(other.m_path),
m_updateType(other.m_updateType){}
m_updates(other.m_updates){}
void MediaUpdateInfoDto::replaceData(MediaUpdateInfoDto &other) {
m_path = other.m_path;
m_updateType = other.m_updateType;
m_updates = other.m_updates;
}
MediaUpdateInfoDto MediaUpdateInfoDto::fromJson(QJsonObject source) {
@ -53,53 +57,23 @@ MediaUpdateInfoDto MediaUpdateInfoDto::fromJson(QJsonObject source) {
void MediaUpdateInfoDto::setFromJson(QJsonObject source) {
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_updateType = Jellyfin::Support::fromJsonValue<QString>(source["UpdateType"]);
m_updates = Jellyfin::Support::fromJsonValue<QList<MediaUpdateInfoPathDto>>(source["Updates"]);
}
QJsonObject MediaUpdateInfoDto::toJson() const {
QJsonObject result;
if (!(m_path.isNull())) {
result["Path"] = Jellyfin::Support::toJsonValue<QString>(m_path);
}
if (!(m_updateType.isNull())) {
result["UpdateType"] = Jellyfin::Support::toJsonValue<QString>(m_updateType);
}
result["Updates"] = Jellyfin::Support::toJsonValue<QList<MediaUpdateInfoPathDto>>(m_updates);
return result;
}
QString MediaUpdateInfoDto::path() const { return m_path; }
QList<MediaUpdateInfoPathDto> MediaUpdateInfoDto::updates() const { return m_updates; }
void MediaUpdateInfoDto::setPath(QString newPath) {
m_path = newPath;
}
bool MediaUpdateInfoDto::pathNull() const {
return m_path.isNull();
void MediaUpdateInfoDto::setUpdates(QList<MediaUpdateInfoPathDto> newUpdates) {
m_updates = newUpdates;
}
void MediaUpdateInfoDto::setPathNull() {
m_path.clear();
}
QString MediaUpdateInfoDto::updateType() const { return m_updateType; }
void MediaUpdateInfoDto::setUpdateType(QString newUpdateType) {
m_updateType = newUpdateType;
}
bool MediaUpdateInfoDto::updateTypeNull() const {
return m_updateType.isNull();
}
void MediaUpdateInfoDto::setUpdateTypeNull() {
m_updateType.clear();
}
} // NS DTO

View file

@ -27,38 +27,38 @@
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/mediaencoderpathdto.h>
#include <JellyfinQt/dto/mediaupdateinfopathdto.h>
namespace Jellyfin {
namespace DTO {
MediaEncoderPathDto::MediaEncoderPathDto() {}
MediaUpdateInfoPathDto::MediaUpdateInfoPathDto() {}
MediaEncoderPathDto::MediaEncoderPathDto(const MediaEncoderPathDto &other) :
MediaUpdateInfoPathDto::MediaUpdateInfoPathDto(const MediaUpdateInfoPathDto &other) :
m_path(other.m_path),
m_pathType(other.m_pathType){}
m_updateType(other.m_updateType){}
void MediaEncoderPathDto::replaceData(MediaEncoderPathDto &other) {
void MediaUpdateInfoPathDto::replaceData(MediaUpdateInfoPathDto &other) {
m_path = other.m_path;
m_pathType = other.m_pathType;
m_updateType = other.m_updateType;
}
MediaEncoderPathDto MediaEncoderPathDto::fromJson(QJsonObject source) {
MediaEncoderPathDto instance;
MediaUpdateInfoPathDto MediaUpdateInfoPathDto::fromJson(QJsonObject source) {
MediaUpdateInfoPathDto instance;
instance.setFromJson(source);
return instance;
}
void MediaEncoderPathDto::setFromJson(QJsonObject source) {
void MediaUpdateInfoPathDto::setFromJson(QJsonObject source) {
m_path = Jellyfin::Support::fromJsonValue<QString>(source["Path"]);
m_pathType = Jellyfin::Support::fromJsonValue<QString>(source["PathType"]);
m_updateType = Jellyfin::Support::fromJsonValue<QString>(source["UpdateType"]);
}
QJsonObject MediaEncoderPathDto::toJson() const {
QJsonObject MediaUpdateInfoPathDto::toJson() const {
QJsonObject result;
@ -67,37 +67,37 @@ QJsonObject MediaEncoderPathDto::toJson() const {
}
if (!(m_pathType.isNull())) {
result["PathType"] = Jellyfin::Support::toJsonValue<QString>(m_pathType);
if (!(m_updateType.isNull())) {
result["UpdateType"] = Jellyfin::Support::toJsonValue<QString>(m_updateType);
}
return result;
}
QString MediaEncoderPathDto::path() const { return m_path; }
QString MediaUpdateInfoPathDto::path() const { return m_path; }
void MediaEncoderPathDto::setPath(QString newPath) {
void MediaUpdateInfoPathDto::setPath(QString newPath) {
m_path = newPath;
}
bool MediaEncoderPathDto::pathNull() const {
bool MediaUpdateInfoPathDto::pathNull() const {
return m_path.isNull();
}
void MediaEncoderPathDto::setPathNull() {
void MediaUpdateInfoPathDto::setPathNull() {
m_path.clear();
}
QString MediaEncoderPathDto::pathType() const { return m_pathType; }
QString MediaUpdateInfoPathDto::updateType() const { return m_updateType; }
void MediaEncoderPathDto::setPathType(QString newPathType) {
m_pathType = newPathType;
void MediaUpdateInfoPathDto::setUpdateType(QString newUpdateType) {
m_updateType = newUpdateType;
}
bool MediaEncoderPathDto::pathTypeNull() const {
return m_pathType.isNull();
bool MediaUpdateInfoPathDto::updateTypeNull() const {
return m_updateType.isNull();
}
void MediaEncoderPathDto::setPathTypeNull() {
m_pathType.clear();
void MediaUpdateInfoPathDto::setUpdateTypeNull() {
m_updateType.clear();
}
@ -105,16 +105,16 @@ void MediaEncoderPathDto::setPathTypeNull() {
namespace Support {
using MediaEncoderPathDto = Jellyfin::DTO::MediaEncoderPathDto;
using MediaUpdateInfoPathDto = Jellyfin::DTO::MediaUpdateInfoPathDto;
template <>
MediaEncoderPathDto fromJsonValue(const QJsonValue &source, convertType<MediaEncoderPathDto>) {
MediaUpdateInfoPathDto fromJsonValue(const QJsonValue &source, convertType<MediaUpdateInfoPathDto>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return MediaEncoderPathDto::fromJson(source.toObject());
return MediaUpdateInfoPathDto::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const MediaEncoderPathDto &source, convertType<MediaEncoderPathDto>) {
QJsonValue toJsonValue(const MediaUpdateInfoPathDto &source, convertType<MediaUpdateInfoPathDto>) {
return source.toJson();
}

View file

@ -0,0 +1,138 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/messagecommand.h>
namespace Jellyfin {
namespace DTO {
MessageCommand::MessageCommand() {}
MessageCommand::MessageCommand (
QString text
) :
m_text(text) { }
MessageCommand::MessageCommand(const MessageCommand &other) :
m_header(other.m_header),
m_text(other.m_text),
m_timeoutMs(other.m_timeoutMs){}
void MessageCommand::replaceData(MessageCommand &other) {
m_header = other.m_header;
m_text = other.m_text;
m_timeoutMs = other.m_timeoutMs;
}
MessageCommand MessageCommand::fromJson(QJsonObject source) {
MessageCommand instance;
instance.setFromJson(source);
return instance;
}
void MessageCommand::setFromJson(QJsonObject source) {
m_header = Jellyfin::Support::fromJsonValue<QString>(source["Header"]);
m_text = Jellyfin::Support::fromJsonValue<QString>(source["Text"]);
m_timeoutMs = Jellyfin::Support::fromJsonValue<std::optional<qint64>>(source["TimeoutMs"]);
}
QJsonObject MessageCommand::toJson() const {
QJsonObject result;
if (!(m_header.isNull())) {
result["Header"] = Jellyfin::Support::toJsonValue<QString>(m_header);
}
result["Text"] = Jellyfin::Support::toJsonValue<QString>(m_text);
if (!(!m_timeoutMs.has_value())) {
result["TimeoutMs"] = Jellyfin::Support::toJsonValue<std::optional<qint64>>(m_timeoutMs);
}
return result;
}
QString MessageCommand::header() const { return m_header; }
void MessageCommand::setHeader(QString newHeader) {
m_header = newHeader;
}
bool MessageCommand::headerNull() const {
return m_header.isNull();
}
void MessageCommand::setHeaderNull() {
m_header.clear();
}
QString MessageCommand::text() const { return m_text; }
void MessageCommand::setText(QString newText) {
m_text = newText;
}
std::optional<qint64> MessageCommand::timeoutMs() const { return m_timeoutMs; }
void MessageCommand::setTimeoutMs(std::optional<qint64> newTimeoutMs) {
m_timeoutMs = newTimeoutMs;
}
bool MessageCommand::timeoutMsNull() const {
return !m_timeoutMs.has_value();
}
void MessageCommand::setTimeoutMsNull() {
m_timeoutMs = std::nullopt;
}
} // NS DTO
namespace Support {
using MessageCommand = Jellyfin::DTO::MessageCommand;
template <>
MessageCommand fromJsonValue(const QJsonValue &source, convertType<MessageCommand>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return MessageCommand::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const MessageCommand &source, convertType<MessageCommand>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

View file

@ -0,0 +1,96 @@
/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
* OVERWRITTEN AT SOME POINT!
*
* If there is a bug in this file, please fix the code generator used to generate this file found in
* core/openapigenerator.d.
*
* This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
* file with a newer file if needed instead of manually updating the files.
*/
#include <JellyfinQt/dto/metadataconfiguration.h>
namespace Jellyfin {
namespace DTO {
MetadataConfiguration::MetadataConfiguration() {}
MetadataConfiguration::MetadataConfiguration (
bool useFileCreationTimeForDateAdded
) :
m_useFileCreationTimeForDateAdded(useFileCreationTimeForDateAdded) { }
MetadataConfiguration::MetadataConfiguration(const MetadataConfiguration &other) :
m_useFileCreationTimeForDateAdded(other.m_useFileCreationTimeForDateAdded){}
void MetadataConfiguration::replaceData(MetadataConfiguration &other) {
m_useFileCreationTimeForDateAdded = other.m_useFileCreationTimeForDateAdded;
}
MetadataConfiguration MetadataConfiguration::fromJson(QJsonObject source) {
MetadataConfiguration instance;
instance.setFromJson(source);
return instance;
}
void MetadataConfiguration::setFromJson(QJsonObject source) {
m_useFileCreationTimeForDateAdded = Jellyfin::Support::fromJsonValue<bool>(source["UseFileCreationTimeForDateAdded"]);
}
QJsonObject MetadataConfiguration::toJson() const {
QJsonObject result;
result["UseFileCreationTimeForDateAdded"] = Jellyfin::Support::toJsonValue<bool>(m_useFileCreationTimeForDateAdded);
return result;
}
bool MetadataConfiguration::useFileCreationTimeForDateAdded() const { return m_useFileCreationTimeForDateAdded; }
void MetadataConfiguration::setUseFileCreationTimeForDateAdded(bool newUseFileCreationTimeForDateAdded) {
m_useFileCreationTimeForDateAdded = newUseFileCreationTimeForDateAdded;
}
} // NS DTO
namespace Support {
using MetadataConfiguration = Jellyfin::DTO::MetadataConfiguration;
template <>
MetadataConfiguration fromJsonValue(const QJsonValue &source, convertType<MetadataConfiguration>) {
if (!source.isObject()) throw ParseException("Expected JSON Object");
return MetadataConfiguration::fromJson(source.toObject());
}
template<>
QJsonValue toJsonValue(const MetadataConfiguration &source, convertType<MetadataConfiguration>) {
return source.toJson();
}
} // NS DTO
} // NS Jellyfin

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