1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 09:15:18 +00:00

Adjust codegeneration to emit simpler classes

This commit is contained in:
Chris Josten 2021-03-20 03:30:50 +01:00
parent 05f79197eb
commit 0358418926
466 changed files with 21405 additions and 13956 deletions

View file

@ -14,11 +14,18 @@ private:
explicit {{className}}Class();
};
typedef {{className}} Class::Value {{className}};
typedef {{className}}Class::Value {{className}};
} // NS DTO
namespace Support {
using {{className}} = Jellyfin::DTO::{{className}};
using {{className}}Class = Jellyfin::DTO::{{className}}Class;
template <>
{{className}} fromJsonValue<{{className}}>(QJsonValue source) {
{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) {
if (!source.isString()) return {{className}}Class::EnumNotSet;
QString str = source.toString();

View file

@ -5,13 +5,12 @@ class {{className}};
{{/if}}
{{/each}}
class {{className}} : public QObject {
Q_OBJECT
class {{className}} {
public:
explicit {{className}}(QObject *parent = nullptr);
static {{className}} *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source, bool emitSignals = true);
QJsonObject toJSON();
explicit {{className}}();
static {{className}} fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
@ -23,26 +22,22 @@ public:
*/
{{/if}}
Q_PROPERTY({{p.typeNameWithQualifiers}} {{p.name}} READ {{p.name}} WRITE set{{p.writeName}} NOTIFY {{p.name}}Changed)
{{/each}}
// Getters
{{#each properties as |p|}}
{{p.typeNameWithQualifiers}} {{p.name}}() const;
{{#if p.description.length > 0}}
/**
* @brief {{p.description}}
*/
{{/if}}
void set{{p.writeName}}({{p.typeNameWithQualifiers}} new{{p.writeName}});
{{/each}}
// Signals
signals:
{{#each properties as |p|}}
void {{p.name}}Changed({{p.typeNameWithQualifiers}} new{{p.writeName}});
{{/each}}
{{#if p.isNullable}}
bool is{{p.writeName}}Null() const;
void set{{p.writeName}}Null();
{{/if}}
{{/each}}
protected:
@ -55,3 +50,16 @@ protected:
{{/each}}
};
} // NS DTO
namespace Support {
using {{className}} = Jellyfin::DTO::{{className}};
template <>
{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return {{className}}::fromJson(source.toObject());
}

View file

@ -1,30 +1,23 @@
{{className}}::{{className}}(QObject *parent) : QObject(parent) {}
{{className}}::{{className}}(QObject *parent) {}
{{className}} *{{className}}::fromJSON(QJsonObject source, QObject *parent) {
{{className}} *instance = new {{className}}(parent);
instance->updateFromJSON(source, false);
{{className}} {{className}}::fromJson(QJsonObject source) {
{{className}} instance;
instance->setFromJson(source, false);
return instance;
}
void {{className}}::updateFromJSON(QJsonObject source, bool emitSignals) {
void {{className}}::setFromJson(QJsonObject source) {
{{#each properties as |property|}}
{{property.memberName}} = fromJsonValue<{{property.typeNameWithQualifiers}}>(source["{{property.originalName}}"]);
{{/each}}
if (emitSignals) {
{{#each properties as |property|}}
emit {{property.name}}Changed({{property.memberName}});
{{/each}}
}
}
QJsonObject {{className}}::toJSON() {
QJsonObject {{className}}::toJson() {
QJsonObject result;
{{#each properties as |property|}}
@ -33,7 +26,7 @@ QJsonObject {{className}}::toJSON() {
{{/each}}
return result;
}"
}
{{#each properties as |property|}}
@ -42,8 +35,14 @@ QJsonObject {{className}}::toJSON() {
void {{className}}::set{{property.writeName}}({{property.typeNameWithQualifiers}} new{{property.writeName}}) {
{{property.memberName}} = new{{property.writeName}};
emit {{property.name}}Changed(new{{property.writeName}});
}
{{#if property.isNullable}}
bool {{className}}::is{{property.writeName}}Null() const {
return {{property.nullableCheck}};
}
void {{className}}::setNull() {
{{property.nullableSetter}};
}
{{/each}}

View file

@ -31,69 +31,82 @@
#define JELLYFIN_DTO_ACCESSSCHEDULE_H
#include <QJsonObject>
#include <QObject>
#include <QString>
#include <QJsonValue>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/dynamicdayofweek.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class AccessSchedule : public QObject {
Q_OBJECT
public:
explicit AccessSchedule(QObject *parent = nullptr);
static AccessSchedule *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class AccessSchedule {
public:
explicit AccessSchedule();
static AccessSchedule fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the id of this instance.
*/
Q_PROPERTY(qint32 jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
qint32 jellyfinId() const;
/**
* @brief Gets or sets the id of this instance.
*/
void setJellyfinId(qint32 newJellyfinId);
/**
* @brief Gets or sets the id of the associated user.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
Q_PROPERTY(DynamicDayOfWeek dayOfWeek READ dayOfWeek WRITE setDayOfWeek NOTIFY dayOfWeekChanged)
QUuid userId() const;
/**
* @brief Gets or sets the id of the associated user.
*/
void setUserId(QUuid newUserId);
DynamicDayOfWeek dayOfWeek() const;
void setDayOfWeek(DynamicDayOfWeek newDayOfWeek);
/**
* @brief Gets or sets the start hour.
*/
Q_PROPERTY(double startHour READ startHour WRITE setStartHour NOTIFY startHourChanged)
double startHour() const;
/**
* @brief Gets or sets the start hour.
*/
void setStartHour(double newStartHour);
/**
* @brief Gets or sets the end hour.
*/
Q_PROPERTY(double endHour READ endHour WRITE setEndHour NOTIFY endHourChanged)
qint32 jellyfinId() const;
void setJellyfinId(qint32 newJellyfinId);
QString userId() const;
void setUserId(QString newUserId);
DynamicDayOfWeek dayOfWeek() const;
void setDayOfWeek(DynamicDayOfWeek newDayOfWeek);
double startHour() const;
void setStartHour(double newStartHour);
double endHour() const;
/**
* @brief Gets or sets the end hour.
*/
void setEndHour(double newEndHour);
signals:
void jellyfinIdChanged(qint32 newJellyfinId);
void userIdChanged(QString newUserId);
void dayOfWeekChanged(DynamicDayOfWeek newDayOfWeek);
void startHourChanged(double newStartHour);
void endHourChanged(double newEndHour);
protected:
qint32 m_jellyfinId;
QString m_userId;
QUuid m_userId;
DynamicDayOfWeek m_dayOfWeek;
double m_startHour;
double m_endHour;
};
} // NS DTO
namespace Support {
using AccessSchedule = Jellyfin::DTO::AccessSchedule;
template <>
AccessSchedule fromJsonValue<AccessSchedule>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AccessSchedule::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,101 +32,103 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/loglevel.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ActivityLogEntry : public QObject {
Q_OBJECT
public:
explicit ActivityLogEntry(QObject *parent = nullptr);
static ActivityLogEntry *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ActivityLogEntry {
public:
explicit ActivityLogEntry();
static ActivityLogEntry fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(qint64 jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
qint64 jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(qint64 newJellyfinId);
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the overview.
*/
Q_PROPERTY(QString overview READ overview WRITE setOverview NOTIFY overviewChanged)
QString overview() const;
/**
* @brief Gets or sets the overview.
*/
void setOverview(QString newOverview);
/**
* @brief Gets or sets the short overview.
*/
Q_PROPERTY(QString shortOverview READ shortOverview WRITE setShortOverview NOTIFY shortOverviewChanged)
QString shortOverview() const;
/**
* @brief Gets or sets the short overview.
*/
void setShortOverview(QString newShortOverview);
/**
* @brief Gets or sets the type.
*/
Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
QString type() const;
/**
* @brief Gets or sets the type.
*/
void setType(QString newType);
/**
* @brief Gets or sets the item identifier.
*/
Q_PROPERTY(QString itemId READ itemId WRITE setItemId NOTIFY itemIdChanged)
QString itemId() const;
/**
* @brief Gets or sets the item identifier.
*/
void setItemId(QString newItemId);
/**
* @brief Gets or sets the date.
*/
Q_PROPERTY(QDateTime date READ date WRITE setDate NOTIFY dateChanged)
QDateTime date() const;
/**
* @brief Gets or sets the date.
*/
void setDate(QDateTime newDate);
/**
* @brief Gets or sets the user identifier.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
QUuid userId() const;
/**
* @brief Gets or sets the user identifier.
*/
void setUserId(QUuid newUserId);
/**
* @brief Gets or sets the user primary image tag.
*/
Q_PROPERTY(QString userPrimaryImageTag READ userPrimaryImageTag WRITE setUserPrimaryImageTag NOTIFY userPrimaryImageTagChanged)
Q_PROPERTY(LogLevel severity READ severity WRITE setSeverity NOTIFY severityChanged)
qint64 jellyfinId() const;
void setJellyfinId(qint64 newJellyfinId);
QString name() const;
void setName(QString newName);
QString overview() const;
void setOverview(QString newOverview);
QString shortOverview() const;
void setShortOverview(QString newShortOverview);
QString type() const;
void setType(QString newType);
QString itemId() const;
void setItemId(QString newItemId);
QDateTime date() const;
void setDate(QDateTime newDate);
QString userId() const;
void setUserId(QString newUserId);
QString userPrimaryImageTag() const;
/**
* @brief Gets or sets the user primary image tag.
*/
void setUserPrimaryImageTag(QString newUserPrimaryImageTag);
LogLevel severity() const;
void setSeverity(LogLevel newSeverity);
signals:
void jellyfinIdChanged(qint64 newJellyfinId);
void nameChanged(QString newName);
void overviewChanged(QString newOverview);
void shortOverviewChanged(QString newShortOverview);
void typeChanged(QString newType);
void itemIdChanged(QString newItemId);
void dateChanged(QDateTime newDate);
void userIdChanged(QString newUserId);
void userPrimaryImageTagChanged(QString newUserPrimaryImageTag);
void severityChanged(LogLevel newSeverity);
protected:
qint64 m_jellyfinId;
QString m_name;
@ -135,11 +137,23 @@ protected:
QString m_type;
QString m_itemId;
QDateTime m_date;
QString m_userId;
QUuid m_userId;
QString m_userPrimaryImageTag;
LogLevel m_severity;
};
} // NS DTO
namespace Support {
using ActivityLogEntry = Jellyfin::DTO::ActivityLogEntry;
template <>
ActivityLogEntry fromJsonValue<ActivityLogEntry>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ActivityLogEntry::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,55 +31,70 @@
#define JELLYFIN_DTO_ACTIVITYLOGENTRYQUERYRESULT_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/activitylogentry.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ActivityLogEntry;
class ActivityLogEntryQueryResult : public QObject {
Q_OBJECT
class ActivityLogEntryQueryResult {
public:
explicit ActivityLogEntryQueryResult(QObject *parent = nullptr);
static ActivityLogEntryQueryResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ActivityLogEntryQueryResult();
static ActivityLogEntryQueryResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the items.
*/
Q_PROPERTY(QList<ActivityLogEntry *> items READ items WRITE setItems NOTIFY itemsChanged)
QList<QSharedPointer<ActivityLogEntry>> items() const;
/**
* @brief Gets or sets the items.
*/
void setItems(QList<QSharedPointer<ActivityLogEntry>> newItems);
/**
* @brief The total number of records available.
*/
Q_PROPERTY(qint32 totalRecordCount READ totalRecordCount WRITE setTotalRecordCount NOTIFY totalRecordCountChanged)
qint32 totalRecordCount() const;
/**
* @brief The total number of records available.
*/
void setTotalRecordCount(qint32 newTotalRecordCount);
/**
* @brief The index of the first record in Items.
*/
Q_PROPERTY(qint32 startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)
QList<ActivityLogEntry *> items() const;
void setItems(QList<ActivityLogEntry *> newItems);
qint32 totalRecordCount() const;
void setTotalRecordCount(qint32 newTotalRecordCount);
qint32 startIndex() const;
/**
* @brief The index of the first record in Items.
*/
void setStartIndex(qint32 newStartIndex);
signals:
void itemsChanged(QList<ActivityLogEntry *> newItems);
void totalRecordCountChanged(qint32 newTotalRecordCount);
void startIndexChanged(qint32 newStartIndex);
protected:
QList<ActivityLogEntry *> m_items;
QList<QSharedPointer<ActivityLogEntry>> m_items;
qint32 m_totalRecordCount;
qint32 m_startIndex;
};
} // NS DTO
namespace Support {
using ActivityLogEntryQueryResult = Jellyfin::DTO::ActivityLogEntryQueryResult;
template <>
ActivityLogEntryQueryResult fromJsonValue<ActivityLogEntryQueryResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ActivityLogEntryQueryResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,32 +31,46 @@
#define JELLYFIN_DTO_ADDVIRTUALFOLDERDTO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <optional>
#include "JellyfinQt/DTO/libraryoptions.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class LibraryOptions;
class AddVirtualFolderDto : public QObject {
Q_OBJECT
class AddVirtualFolderDto {
public:
explicit AddVirtualFolderDto(QObject *parent = nullptr);
static AddVirtualFolderDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AddVirtualFolderDto();
static AddVirtualFolderDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(LibraryOptions * libraryOptions READ libraryOptions WRITE setLibraryOptions NOTIFY libraryOptionsChanged)
// Properties
LibraryOptions * libraryOptions() const;
void setLibraryOptions(LibraryOptions * newLibraryOptions);
QSharedPointer<LibraryOptions> libraryOptions() const;
void setLibraryOptions(QSharedPointer<LibraryOptions> newLibraryOptions);
signals:
void libraryOptionsChanged(LibraryOptions * newLibraryOptions);
protected:
LibraryOptions * m_libraryOptions = nullptr;
QSharedPointer<LibraryOptions> m_libraryOptions = nullptr;
};
} // NS DTO
namespace Support {
using AddVirtualFolderDto = Jellyfin::DTO::AddVirtualFolderDto;
template <>
AddVirtualFolderDto fromJsonValue<AddVirtualFolderDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AddVirtualFolderDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,115 +32,113 @@
#include <QDateTime>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/songinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class SongInfo;
class AlbumInfo : public QObject {
Q_OBJECT
class AlbumInfo {
public:
explicit AlbumInfo(QObject *parent = nullptr);
static AlbumInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AlbumInfo();
static AlbumInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
/**
* @brief Gets or sets the metadata language.
*/
Q_PROPERTY(QString metadataLanguage READ metadataLanguage WRITE setMetadataLanguage NOTIFY metadataLanguageChanged)
QString metadataLanguage() const;
/**
* @brief Gets or sets the metadata language.
*/
void setMetadataLanguage(QString newMetadataLanguage);
/**
* @brief Gets or sets the metadata country code.
*/
Q_PROPERTY(QString metadataCountryCode READ metadataCountryCode WRITE setMetadataCountryCode NOTIFY metadataCountryCodeChanged)
QString metadataCountryCode() const;
/**
* @brief Gets or sets the metadata country code.
*/
void setMetadataCountryCode(QString newMetadataCountryCode);
/**
* @brief Gets or sets the provider ids.
*/
Q_PROPERTY(QJsonObject providerIds READ providerIds WRITE setProviderIds NOTIFY providerIdsChanged)
QJsonObject providerIds() const;
/**
* @brief Gets or sets the provider ids.
*/
void setProviderIds(QJsonObject newProviderIds);
/**
* @brief Gets or sets the year.
*/
Q_PROPERTY(qint32 year READ year WRITE setYear NOTIFY yearChanged)
Q_PROPERTY(qint32 indexNumber READ indexNumber WRITE setIndexNumber NOTIFY indexNumberChanged)
Q_PROPERTY(qint32 parentIndexNumber READ parentIndexNumber WRITE setParentIndexNumber NOTIFY parentIndexNumberChanged)
Q_PROPERTY(QDateTime premiereDate READ premiereDate WRITE setPremiereDate NOTIFY premiereDateChanged)
Q_PROPERTY(bool isAutomated READ isAutomated WRITE setIsAutomated NOTIFY isAutomatedChanged)
/**
* @brief Gets or sets the album artist.
*/
Q_PROPERTY(QStringList albumArtists READ albumArtists WRITE setAlbumArtists NOTIFY albumArtistsChanged)
/**
* @brief Gets or sets the artist provider ids.
*/
Q_PROPERTY(QJsonObject artistProviderIds READ artistProviderIds WRITE setArtistProviderIds NOTIFY artistProviderIdsChanged)
Q_PROPERTY(QList<SongInfo *> songInfos READ songInfos WRITE setSongInfos NOTIFY songInfosChanged)
QString name() const;
void setName(QString newName);
QString path() const;
void setPath(QString newPath);
QString metadataLanguage() const;
void setMetadataLanguage(QString newMetadataLanguage);
QString metadataCountryCode() const;
void setMetadataCountryCode(QString newMetadataCountryCode);
QJsonObject providerIds() const;
void setProviderIds(QJsonObject newProviderIds);
qint32 year() const;
/**
* @brief Gets or sets the year.
*/
void setYear(qint32 newYear);
qint32 indexNumber() const;
void setIndexNumber(qint32 newIndexNumber);
qint32 parentIndexNumber() const;
void setParentIndexNumber(qint32 newParentIndexNumber);
QDateTime premiereDate() const;
void setPremiereDate(QDateTime newPremiereDate);
bool isAutomated() const;
void setIsAutomated(bool newIsAutomated);
/**
* @brief Gets or sets the album artist.
*/
QStringList albumArtists() const;
/**
* @brief Gets or sets the album artist.
*/
void setAlbumArtists(QStringList newAlbumArtists);
/**
* @brief Gets or sets the artist provider ids.
*/
QJsonObject artistProviderIds() const;
/**
* @brief Gets or sets the artist provider ids.
*/
void setArtistProviderIds(QJsonObject newArtistProviderIds);
QList<SongInfo *> songInfos() const;
void setSongInfos(QList<SongInfo *> newSongInfos);
QList<QSharedPointer<SongInfo>> songInfos() const;
void setSongInfos(QList<QSharedPointer<SongInfo>> newSongInfos);
signals:
void nameChanged(QString newName);
void pathChanged(QString newPath);
void metadataLanguageChanged(QString newMetadataLanguage);
void metadataCountryCodeChanged(QString newMetadataCountryCode);
void providerIdsChanged(QJsonObject newProviderIds);
void yearChanged(qint32 newYear);
void indexNumberChanged(qint32 newIndexNumber);
void parentIndexNumberChanged(qint32 newParentIndexNumber);
void premiereDateChanged(QDateTime newPremiereDate);
void isAutomatedChanged(bool newIsAutomated);
void albumArtistsChanged(QStringList newAlbumArtists);
void artistProviderIdsChanged(QJsonObject newArtistProviderIds);
void songInfosChanged(QList<SongInfo *> newSongInfos);
protected:
QString m_name;
QString m_path;
@ -154,9 +152,21 @@ protected:
bool m_isAutomated;
QStringList m_albumArtists;
QJsonObject m_artistProviderIds;
QList<SongInfo *> m_songInfos;
QList<QSharedPointer<SongInfo>> m_songInfos;
};
} // NS DTO
namespace Support {
using AlbumInfo = Jellyfin::DTO::AlbumInfo;
template <>
AlbumInfo fromJsonValue<AlbumInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AlbumInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,57 +31,71 @@
#define JELLYFIN_DTO_ALBUMINFOREMOTESEARCHQUERY_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/albuminfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class AlbumInfo;
class AlbumInfoRemoteSearchQuery : public QObject {
Q_OBJECT
class AlbumInfoRemoteSearchQuery {
public:
explicit AlbumInfoRemoteSearchQuery(QObject *parent = nullptr);
static AlbumInfoRemoteSearchQuery *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AlbumInfoRemoteSearchQuery();
static AlbumInfoRemoteSearchQuery fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(AlbumInfo * searchInfo READ searchInfo WRITE setSearchInfo NOTIFY searchInfoChanged)
Q_PROPERTY(QString itemId READ itemId WRITE setItemId NOTIFY itemIdChanged)
// Properties
QSharedPointer<AlbumInfo> searchInfo() const;
void setSearchInfo(QSharedPointer<AlbumInfo> newSearchInfo);
QUuid itemId() const;
void setItemId(QUuid newItemId);
/**
* @brief Will only search within the given provider when set.
*/
Q_PROPERTY(QString searchProviderName READ searchProviderName WRITE setSearchProviderName NOTIFY searchProviderNameChanged)
QString searchProviderName() const;
/**
* @brief Will only search within the given provider when set.
*/
void setSearchProviderName(QString newSearchProviderName);
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
Q_PROPERTY(bool includeDisabledProviders READ includeDisabledProviders WRITE setIncludeDisabledProviders NOTIFY includeDisabledProvidersChanged)
AlbumInfo * searchInfo() const;
void setSearchInfo(AlbumInfo * newSearchInfo);
QString itemId() const;
void setItemId(QString newItemId);
QString searchProviderName() const;
void setSearchProviderName(QString newSearchProviderName);
bool includeDisabledProviders() const;
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
void setIncludeDisabledProviders(bool newIncludeDisabledProviders);
signals:
void searchInfoChanged(AlbumInfo * newSearchInfo);
void itemIdChanged(QString newItemId);
void searchProviderNameChanged(QString newSearchProviderName);
void includeDisabledProvidersChanged(bool newIncludeDisabledProviders);
protected:
AlbumInfo * m_searchInfo = nullptr;
QString m_itemId;
QSharedPointer<AlbumInfo> m_searchInfo = nullptr;
QUuid m_itemId;
QString m_searchProviderName;
bool m_includeDisabledProviders;
};
} // NS DTO
namespace Support {
using AlbumInfoRemoteSearchQuery = Jellyfin::DTO::AlbumInfoRemoteSearchQuery;
template <>
AlbumInfoRemoteSearchQuery fromJsonValue<AlbumInfoRemoteSearchQuery>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AlbumInfoRemoteSearchQuery::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,46 +31,56 @@
#define JELLYFIN_DTO_ALLTHEMEMEDIARESULT_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <optional>
#include "JellyfinQt/DTO/thememediaresult.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ThemeMediaResult;
class ThemeMediaResult;
class ThemeMediaResult;
class AllThemeMediaResult : public QObject {
Q_OBJECT
class AllThemeMediaResult {
public:
explicit AllThemeMediaResult(QObject *parent = nullptr);
static AllThemeMediaResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AllThemeMediaResult();
static AllThemeMediaResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(ThemeMediaResult * themeVideosResult READ themeVideosResult WRITE setThemeVideosResult NOTIFY themeVideosResultChanged)
Q_PROPERTY(ThemeMediaResult * themeSongsResult READ themeSongsResult WRITE setThemeSongsResult NOTIFY themeSongsResultChanged)
Q_PROPERTY(ThemeMediaResult * soundtrackSongsResult READ soundtrackSongsResult WRITE setSoundtrackSongsResult NOTIFY soundtrackSongsResultChanged)
// Properties
ThemeMediaResult * themeVideosResult() const;
void setThemeVideosResult(ThemeMediaResult * newThemeVideosResult);
QSharedPointer<ThemeMediaResult> themeVideosResult() const;
ThemeMediaResult * themeSongsResult() const;
void setThemeSongsResult(ThemeMediaResult * newThemeSongsResult);
void setThemeVideosResult(QSharedPointer<ThemeMediaResult> newThemeVideosResult);
ThemeMediaResult * soundtrackSongsResult() const;
void setSoundtrackSongsResult(ThemeMediaResult * newSoundtrackSongsResult);
QSharedPointer<ThemeMediaResult> themeSongsResult() const;
void setThemeSongsResult(QSharedPointer<ThemeMediaResult> newThemeSongsResult);
QSharedPointer<ThemeMediaResult> soundtrackSongsResult() const;
void setSoundtrackSongsResult(QSharedPointer<ThemeMediaResult> newSoundtrackSongsResult);
signals:
void themeVideosResultChanged(ThemeMediaResult * newThemeVideosResult);
void themeSongsResultChanged(ThemeMediaResult * newThemeSongsResult);
void soundtrackSongsResultChanged(ThemeMediaResult * newSoundtrackSongsResult);
protected:
ThemeMediaResult * m_themeVideosResult = nullptr;
ThemeMediaResult * m_themeSongsResult = nullptr;
ThemeMediaResult * m_soundtrackSongsResult = nullptr;
QSharedPointer<ThemeMediaResult> m_themeVideosResult = nullptr;
QSharedPointer<ThemeMediaResult> m_themeSongsResult = nullptr;
QSharedPointer<ThemeMediaResult> m_soundtrackSongsResult = nullptr;
};
} // NS DTO
namespace Support {
using AllThemeMediaResult = Jellyfin::DTO::AllThemeMediaResult;
template <>
AllThemeMediaResult fromJsonValue<AllThemeMediaResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AllThemeMediaResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_ARCHITECTURE_H
#define JELLYFIN_DTO_ARCHITECTURE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ArchitectureClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
X86,
X64,
Arm,
@ -49,8 +54,40 @@ public:
private:
explicit ArchitectureClass();
};
typedef ArchitectureClass::Value Architecture;
} // NS DTO
namespace Support {
using Architecture = Jellyfin::DTO::Architecture;
using ArchitectureClass = Jellyfin::DTO::ArchitectureClass;
template <>
Architecture fromJsonValue<Architecture>(const QJsonValue &source) {
if (!source.isString()) return ArchitectureClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("X86")) {
return ArchitectureClass::X86;
}
if (str == QStringLiteral("X64")) {
return ArchitectureClass::X64;
}
if (str == QStringLiteral("Arm")) {
return ArchitectureClass::Arm;
}
if (str == QStringLiteral("Arm64")) {
return ArchitectureClass::Arm64;
}
if (str == QStringLiteral("Wasm")) {
return ArchitectureClass::Wasm;
}
return ArchitectureClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,99 +32,97 @@
#include <QDateTime>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/songinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class SongInfo;
class ArtistInfo : public QObject {
Q_OBJECT
class ArtistInfo {
public:
explicit ArtistInfo(QObject *parent = nullptr);
static ArtistInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ArtistInfo();
static ArtistInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
/**
* @brief Gets or sets the metadata language.
*/
Q_PROPERTY(QString metadataLanguage READ metadataLanguage WRITE setMetadataLanguage NOTIFY metadataLanguageChanged)
QString metadataLanguage() const;
/**
* @brief Gets or sets the metadata language.
*/
void setMetadataLanguage(QString newMetadataLanguage);
/**
* @brief Gets or sets the metadata country code.
*/
Q_PROPERTY(QString metadataCountryCode READ metadataCountryCode WRITE setMetadataCountryCode NOTIFY metadataCountryCodeChanged)
QString metadataCountryCode() const;
/**
* @brief Gets or sets the metadata country code.
*/
void setMetadataCountryCode(QString newMetadataCountryCode);
/**
* @brief Gets or sets the provider ids.
*/
Q_PROPERTY(QJsonObject providerIds READ providerIds WRITE setProviderIds NOTIFY providerIdsChanged)
QJsonObject providerIds() const;
/**
* @brief Gets or sets the provider ids.
*/
void setProviderIds(QJsonObject newProviderIds);
/**
* @brief Gets or sets the year.
*/
Q_PROPERTY(qint32 year READ year WRITE setYear NOTIFY yearChanged)
Q_PROPERTY(qint32 indexNumber READ indexNumber WRITE setIndexNumber NOTIFY indexNumberChanged)
Q_PROPERTY(qint32 parentIndexNumber READ parentIndexNumber WRITE setParentIndexNumber NOTIFY parentIndexNumberChanged)
Q_PROPERTY(QDateTime premiereDate READ premiereDate WRITE setPremiereDate NOTIFY premiereDateChanged)
Q_PROPERTY(bool isAutomated READ isAutomated WRITE setIsAutomated NOTIFY isAutomatedChanged)
Q_PROPERTY(QList<SongInfo *> songInfos READ songInfos WRITE setSongInfos NOTIFY songInfosChanged)
QString name() const;
void setName(QString newName);
QString path() const;
void setPath(QString newPath);
QString metadataLanguage() const;
void setMetadataLanguage(QString newMetadataLanguage);
QString metadataCountryCode() const;
void setMetadataCountryCode(QString newMetadataCountryCode);
QJsonObject providerIds() const;
void setProviderIds(QJsonObject newProviderIds);
qint32 year() const;
/**
* @brief Gets or sets the year.
*/
void setYear(qint32 newYear);
qint32 indexNumber() const;
void setIndexNumber(qint32 newIndexNumber);
qint32 parentIndexNumber() const;
void setParentIndexNumber(qint32 newParentIndexNumber);
QDateTime premiereDate() const;
void setPremiereDate(QDateTime newPremiereDate);
bool isAutomated() const;
void setIsAutomated(bool newIsAutomated);
QList<SongInfo *> songInfos() const;
void setSongInfos(QList<SongInfo *> newSongInfos);
QList<QSharedPointer<SongInfo>> songInfos() const;
void setSongInfos(QList<QSharedPointer<SongInfo>> newSongInfos);
signals:
void nameChanged(QString newName);
void pathChanged(QString newPath);
void metadataLanguageChanged(QString newMetadataLanguage);
void metadataCountryCodeChanged(QString newMetadataCountryCode);
void providerIdsChanged(QJsonObject newProviderIds);
void yearChanged(qint32 newYear);
void indexNumberChanged(qint32 newIndexNumber);
void parentIndexNumberChanged(qint32 newParentIndexNumber);
void premiereDateChanged(QDateTime newPremiereDate);
void isAutomatedChanged(bool newIsAutomated);
void songInfosChanged(QList<SongInfo *> newSongInfos);
protected:
QString m_name;
QString m_path;
@ -136,9 +134,21 @@ protected:
qint32 m_parentIndexNumber;
QDateTime m_premiereDate;
bool m_isAutomated;
QList<SongInfo *> m_songInfos;
QList<QSharedPointer<SongInfo>> m_songInfos;
};
} // NS DTO
namespace Support {
using ArtistInfo = Jellyfin::DTO::ArtistInfo;
template <>
ArtistInfo fromJsonValue<ArtistInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ArtistInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,57 +31,71 @@
#define JELLYFIN_DTO_ARTISTINFOREMOTESEARCHQUERY_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/artistinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ArtistInfo;
class ArtistInfoRemoteSearchQuery : public QObject {
Q_OBJECT
class ArtistInfoRemoteSearchQuery {
public:
explicit ArtistInfoRemoteSearchQuery(QObject *parent = nullptr);
static ArtistInfoRemoteSearchQuery *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ArtistInfoRemoteSearchQuery();
static ArtistInfoRemoteSearchQuery fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(ArtistInfo * searchInfo READ searchInfo WRITE setSearchInfo NOTIFY searchInfoChanged)
Q_PROPERTY(QString itemId READ itemId WRITE setItemId NOTIFY itemIdChanged)
// Properties
QSharedPointer<ArtistInfo> searchInfo() const;
void setSearchInfo(QSharedPointer<ArtistInfo> newSearchInfo);
QUuid itemId() const;
void setItemId(QUuid newItemId);
/**
* @brief Will only search within the given provider when set.
*/
Q_PROPERTY(QString searchProviderName READ searchProviderName WRITE setSearchProviderName NOTIFY searchProviderNameChanged)
QString searchProviderName() const;
/**
* @brief Will only search within the given provider when set.
*/
void setSearchProviderName(QString newSearchProviderName);
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
Q_PROPERTY(bool includeDisabledProviders READ includeDisabledProviders WRITE setIncludeDisabledProviders NOTIFY includeDisabledProvidersChanged)
ArtistInfo * searchInfo() const;
void setSearchInfo(ArtistInfo * newSearchInfo);
QString itemId() const;
void setItemId(QString newItemId);
QString searchProviderName() const;
void setSearchProviderName(QString newSearchProviderName);
bool includeDisabledProviders() const;
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
void setIncludeDisabledProviders(bool newIncludeDisabledProviders);
signals:
void searchInfoChanged(ArtistInfo * newSearchInfo);
void itemIdChanged(QString newItemId);
void searchProviderNameChanged(QString newSearchProviderName);
void includeDisabledProvidersChanged(bool newIncludeDisabledProviders);
protected:
ArtistInfo * m_searchInfo = nullptr;
QString m_itemId;
QSharedPointer<ArtistInfo> m_searchInfo = nullptr;
QUuid m_itemId;
QString m_searchProviderName;
bool m_includeDisabledProviders;
};
} // NS DTO
namespace Support {
using ArtistInfoRemoteSearchQuery = Jellyfin::DTO::ArtistInfoRemoteSearchQuery;
template <>
ArtistInfoRemoteSearchQuery fromJsonValue<ArtistInfoRemoteSearchQuery>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ArtistInfoRemoteSearchQuery::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,52 +31,67 @@
#define JELLYFIN_DTO_AUTHENTICATEUSERBYNAME_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class AuthenticateUserByName : public QObject {
Q_OBJECT
public:
explicit AuthenticateUserByName(QObject *parent = nullptr);
static AuthenticateUserByName *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class AuthenticateUserByName {
public:
explicit AuthenticateUserByName();
static AuthenticateUserByName fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the username.
*/
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
QString username() const;
/**
* @brief Gets or sets the username.
*/
void setUsername(QString newUsername);
/**
* @brief Gets or sets the plain text password.
*/
Q_PROPERTY(QString pw READ pw WRITE setPw NOTIFY pwChanged)
QString pw() const;
/**
* @brief Gets or sets the plain text password.
*/
void setPw(QString newPw);
/**
* @brief Gets or sets the sha1-hashed password.
*/
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
QString username() const;
void setUsername(QString newUsername);
QString pw() const;
void setPw(QString newPw);
QString password() const;
/**
* @brief Gets or sets the sha1-hashed password.
*/
void setPassword(QString newPassword);
signals:
void usernameChanged(QString newUsername);
void pwChanged(QString newPw);
void passwordChanged(QString newPassword);
protected:
QString m_username;
QString m_pw;
QString m_password;
};
} // NS DTO
namespace Support {
using AuthenticateUserByName = Jellyfin::DTO::AuthenticateUserByName;
template <>
AuthenticateUserByName fromJsonValue<AuthenticateUserByName>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AuthenticateUserByName::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,112 +32,114 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class AuthenticationInfo : public QObject {
Q_OBJECT
public:
explicit AuthenticationInfo(QObject *parent = nullptr);
static AuthenticationInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class AuthenticationInfo {
public:
explicit AuthenticationInfo();
static AuthenticationInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(qint64 jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
qint64 jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(qint64 newJellyfinId);
/**
* @brief Gets or sets the access token.
*/
Q_PROPERTY(QString accessToken READ accessToken WRITE setAccessToken NOTIFY accessTokenChanged)
QString accessToken() const;
/**
* @brief Gets or sets the access token.
*/
void setAccessToken(QString newAccessToken);
/**
* @brief Gets or sets the device identifier.
*/
Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged)
QString deviceId() const;
/**
* @brief Gets or sets the device identifier.
*/
void setDeviceId(QString newDeviceId);
/**
* @brief Gets or sets the name of the application.
*/
Q_PROPERTY(QString appName READ appName WRITE setAppName NOTIFY appNameChanged)
QString appName() const;
/**
* @brief Gets or sets the name of the application.
*/
void setAppName(QString newAppName);
/**
* @brief Gets or sets the application version.
*/
Q_PROPERTY(QString appVersion READ appVersion WRITE setAppVersion NOTIFY appVersionChanged)
QString appVersion() const;
/**
* @brief Gets or sets the application version.
*/
void setAppVersion(QString newAppVersion);
/**
* @brief Gets or sets the name of the device.
*/
Q_PROPERTY(QString deviceName READ deviceName WRITE setDeviceName NOTIFY deviceNameChanged)
QString deviceName() const;
/**
* @brief Gets or sets the name of the device.
*/
void setDeviceName(QString newDeviceName);
/**
* @brief Gets or sets the user identifier.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
QUuid userId() const;
/**
* @brief Gets or sets the user identifier.
*/
void setUserId(QUuid newUserId);
/**
* @brief Gets or sets a value indicating whether this instance is active.
*/
Q_PROPERTY(bool isActive READ isActive WRITE setIsActive NOTIFY isActiveChanged)
bool isActive() const;
/**
* @brief Gets or sets a value indicating whether this instance is active.
*/
void setIsActive(bool newIsActive);
/**
* @brief Gets or sets the date created.
*/
Q_PROPERTY(QDateTime dateCreated READ dateCreated WRITE setDateCreated NOTIFY dateCreatedChanged)
QDateTime dateCreated() const;
/**
* @brief Gets or sets the date created.
*/
void setDateCreated(QDateTime newDateCreated);
/**
* @brief Gets or sets the date revoked.
*/
Q_PROPERTY(QDateTime dateRevoked READ dateRevoked WRITE setDateRevoked NOTIFY dateRevokedChanged)
Q_PROPERTY(QDateTime dateLastActivity READ dateLastActivity WRITE setDateLastActivity NOTIFY dateLastActivityChanged)
Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
qint64 jellyfinId() const;
void setJellyfinId(qint64 newJellyfinId);
QString accessToken() const;
void setAccessToken(QString newAccessToken);
QString deviceId() const;
void setDeviceId(QString newDeviceId);
QString appName() const;
void setAppName(QString newAppName);
QString appVersion() const;
void setAppVersion(QString newAppVersion);
QString deviceName() const;
void setDeviceName(QString newDeviceName);
QString userId() const;
void setUserId(QString newUserId);
bool isActive() const;
void setIsActive(bool newIsActive);
QDateTime dateCreated() const;
void setDateCreated(QDateTime newDateCreated);
QDateTime dateRevoked() const;
/**
* @brief Gets or sets the date revoked.
*/
void setDateRevoked(QDateTime newDateRevoked);
QDateTime dateLastActivity() const;
void setDateLastActivity(QDateTime newDateLastActivity);
QString userName() const;
void setUserName(QString newUserName);
signals:
void jellyfinIdChanged(qint64 newJellyfinId);
void accessTokenChanged(QString newAccessToken);
void deviceIdChanged(QString newDeviceId);
void appNameChanged(QString newAppName);
void appVersionChanged(QString newAppVersion);
void deviceNameChanged(QString newDeviceName);
void userIdChanged(QString newUserId);
void isActiveChanged(bool newIsActive);
void dateCreatedChanged(QDateTime newDateCreated);
void dateRevokedChanged(QDateTime newDateRevoked);
void dateLastActivityChanged(QDateTime newDateLastActivity);
void userNameChanged(QString newUserName);
protected:
qint64 m_jellyfinId;
QString m_accessToken;
@ -145,7 +147,7 @@ protected:
QString m_appName;
QString m_appVersion;
QString m_deviceName;
QString m_userId;
QUuid m_userId;
bool m_isActive;
QDateTime m_dateCreated;
QDateTime m_dateRevoked;
@ -153,6 +155,18 @@ protected:
QString m_userName;
};
} // NS DTO
namespace Support {
using AuthenticationInfo = Jellyfin::DTO::AuthenticationInfo;
template <>
AuthenticationInfo fromJsonValue<AuthenticationInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AuthenticationInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,55 +31,70 @@
#define JELLYFIN_DTO_AUTHENTICATIONINFOQUERYRESULT_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/authenticationinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class AuthenticationInfo;
class AuthenticationInfoQueryResult : public QObject {
Q_OBJECT
class AuthenticationInfoQueryResult {
public:
explicit AuthenticationInfoQueryResult(QObject *parent = nullptr);
static AuthenticationInfoQueryResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AuthenticationInfoQueryResult();
static AuthenticationInfoQueryResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the items.
*/
Q_PROPERTY(QList<AuthenticationInfo *> items READ items WRITE setItems NOTIFY itemsChanged)
QList<QSharedPointer<AuthenticationInfo>> items() const;
/**
* @brief Gets or sets the items.
*/
void setItems(QList<QSharedPointer<AuthenticationInfo>> newItems);
/**
* @brief The total number of records available.
*/
Q_PROPERTY(qint32 totalRecordCount READ totalRecordCount WRITE setTotalRecordCount NOTIFY totalRecordCountChanged)
qint32 totalRecordCount() const;
/**
* @brief The total number of records available.
*/
void setTotalRecordCount(qint32 newTotalRecordCount);
/**
* @brief The index of the first record in Items.
*/
Q_PROPERTY(qint32 startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)
QList<AuthenticationInfo *> items() const;
void setItems(QList<AuthenticationInfo *> newItems);
qint32 totalRecordCount() const;
void setTotalRecordCount(qint32 newTotalRecordCount);
qint32 startIndex() const;
/**
* @brief The index of the first record in Items.
*/
void setStartIndex(qint32 newStartIndex);
signals:
void itemsChanged(QList<AuthenticationInfo *> newItems);
void totalRecordCountChanged(qint32 newTotalRecordCount);
void startIndexChanged(qint32 newStartIndex);
protected:
QList<AuthenticationInfo *> m_items;
QList<QSharedPointer<AuthenticationInfo>> m_items;
qint32 m_totalRecordCount;
qint32 m_startIndex;
};
} // NS DTO
namespace Support {
using AuthenticationInfoQueryResult = Jellyfin::DTO::AuthenticationInfoQueryResult;
template <>
AuthenticationInfoQueryResult fromJsonValue<AuthenticationInfoQueryResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AuthenticationInfoQueryResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,52 +31,63 @@
#define JELLYFIN_DTO_AUTHENTICATIONRESULT_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/sessioninfo.h"
#include "JellyfinQt/DTO/userdto.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class SessionInfo;
class UserDto;
class AuthenticationResult : public QObject {
Q_OBJECT
class AuthenticationResult {
public:
explicit AuthenticationResult(QObject *parent = nullptr);
static AuthenticationResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit AuthenticationResult();
static AuthenticationResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(UserDto * user READ user WRITE setUser NOTIFY userChanged)
Q_PROPERTY(SessionInfo * sessionInfo READ sessionInfo WRITE setSessionInfo NOTIFY sessionInfoChanged)
Q_PROPERTY(QString accessToken READ accessToken WRITE setAccessToken NOTIFY accessTokenChanged)
Q_PROPERTY(QString serverId READ serverId WRITE setServerId NOTIFY serverIdChanged)
// Properties
UserDto * user() const;
void setUser(UserDto * newUser);
QSharedPointer<UserDto> user() const;
SessionInfo * sessionInfo() const;
void setSessionInfo(SessionInfo * newSessionInfo);
void setUser(QSharedPointer<UserDto> newUser);
QSharedPointer<SessionInfo> sessionInfo() const;
void setSessionInfo(QSharedPointer<SessionInfo> newSessionInfo);
QString accessToken() const;
void setAccessToken(QString newAccessToken);
QString serverId() const;
void setServerId(QString newServerId);
signals:
void userChanged(UserDto * newUser);
void sessionInfoChanged(SessionInfo * newSessionInfo);
void accessTokenChanged(QString newAccessToken);
void serverIdChanged(QString newServerId);
protected:
UserDto * m_user = nullptr;
SessionInfo * m_sessionInfo = nullptr;
QSharedPointer<UserDto> m_user = nullptr;
QSharedPointer<SessionInfo> m_sessionInfo = nullptr;
QString m_accessToken;
QString m_serverId;
};
} // NS DTO
namespace Support {
using AuthenticationResult = Jellyfin::DTO::AuthenticationResult;
template <>
AuthenticationResult fromJsonValue<AuthenticationResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return AuthenticationResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,98 +32,104 @@
#include <QDateTime>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/mediaurl.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class MediaUrl;
class BaseItem : public QObject {
Q_OBJECT
class BaseItem {
public:
explicit BaseItem(QObject *parent = nullptr);
static BaseItem *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit BaseItem();
static BaseItem fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(qint64 size READ size WRITE setSize NOTIFY sizeChanged)
Q_PROPERTY(QString container READ container WRITE setContainer NOTIFY containerChanged)
Q_PROPERTY(QDateTime dateLastSaved READ dateLastSaved WRITE setDateLastSaved NOTIFY dateLastSavedChanged)
/**
* @brief Gets or sets the remote trailers.
*/
Q_PROPERTY(QList<MediaUrl *> remoteTrailers READ remoteTrailers WRITE setRemoteTrailers NOTIFY remoteTrailersChanged)
Q_PROPERTY(bool isHD READ isHD WRITE setIsHD NOTIFY isHDChanged)
Q_PROPERTY(bool isShortcut READ isShortcut WRITE setIsShortcut NOTIFY isShortcutChanged)
Q_PROPERTY(QString shortcutPath READ shortcutPath WRITE setShortcutPath NOTIFY shortcutPathChanged)
Q_PROPERTY(qint32 width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(qint32 height READ height WRITE setHeight NOTIFY heightChanged)
Q_PROPERTY(QStringList extraIds READ extraIds WRITE setExtraIds NOTIFY extraIdsChanged)
Q_PROPERTY(bool supportsExternalTransfer READ supportsExternalTransfer WRITE setSupportsExternalTransfer NOTIFY supportsExternalTransferChanged)
// Properties
qint64 size() const;
void setSize(qint64 newSize);
QString container() const;
void setContainer(QString newContainer);
QDateTime dateLastSaved() const;
void setDateLastSaved(QDateTime newDateLastSaved);
QList<MediaUrl *> remoteTrailers() const;
void setRemoteTrailers(QList<MediaUrl *> newRemoteTrailers);
void setDateLastSaved(QDateTime newDateLastSaved);
/**
* @brief Gets or sets the remote trailers.
*/
QList<QSharedPointer<MediaUrl>> remoteTrailers() const;
/**
* @brief Gets or sets the remote trailers.
*/
void setRemoteTrailers(QList<QSharedPointer<MediaUrl>> newRemoteTrailers);
bool isHD() const;
void setIsHD(bool newIsHD);
bool isShortcut() const;
void setIsShortcut(bool newIsShortcut);
QString shortcutPath() const;
void setShortcutPath(QString newShortcutPath);
qint32 width() const;
void setWidth(qint32 newWidth);
qint32 height() const;
void setHeight(qint32 newHeight);
QStringList extraIds() const;
void setExtraIds(QStringList newExtraIds);
QList<QUuid> extraIds() const;
void setExtraIds(QList<QUuid> newExtraIds);
bool supportsExternalTransfer() const;
void setSupportsExternalTransfer(bool newSupportsExternalTransfer);
signals:
void sizeChanged(qint64 newSize);
void containerChanged(QString newContainer);
void dateLastSavedChanged(QDateTime newDateLastSaved);
void remoteTrailersChanged(QList<MediaUrl *> newRemoteTrailers);
void isHDChanged(bool newIsHD);
void isShortcutChanged(bool newIsShortcut);
void shortcutPathChanged(QString newShortcutPath);
void widthChanged(qint32 newWidth);
void heightChanged(qint32 newHeight);
void extraIdsChanged(QStringList newExtraIds);
void supportsExternalTransferChanged(bool newSupportsExternalTransfer);
protected:
qint64 m_size;
QString m_container;
QDateTime m_dateLastSaved;
QList<MediaUrl *> m_remoteTrailers;
QList<QSharedPointer<MediaUrl>> m_remoteTrailers;
bool m_isHD;
bool m_isShortcut;
QString m_shortcutPath;
qint32 m_width;
qint32 m_height;
QStringList m_extraIds;
QList<QUuid> m_extraIds;
bool m_supportsExternalTransfer;
};
} // NS DTO
namespace Support {
using BaseItem = Jellyfin::DTO::BaseItem;
template <>
BaseItem fromJsonValue<BaseItem>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BaseItem::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

File diff suppressed because it is too large Load diff

View file

@ -31,55 +31,70 @@
#define JELLYFIN_DTO_BASEITEMDTOQUERYRESULT_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/baseitemdto.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BaseItemDto;
class BaseItemDtoQueryResult : public QObject {
Q_OBJECT
class BaseItemDtoQueryResult {
public:
explicit BaseItemDtoQueryResult(QObject *parent = nullptr);
static BaseItemDtoQueryResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit BaseItemDtoQueryResult();
static BaseItemDtoQueryResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the items.
*/
Q_PROPERTY(QList<BaseItemDto *> items READ items WRITE setItems NOTIFY itemsChanged)
QList<QSharedPointer<BaseItemDto>> items() const;
/**
* @brief Gets or sets the items.
*/
void setItems(QList<QSharedPointer<BaseItemDto>> newItems);
/**
* @brief The total number of records available.
*/
Q_PROPERTY(qint32 totalRecordCount READ totalRecordCount WRITE setTotalRecordCount NOTIFY totalRecordCountChanged)
qint32 totalRecordCount() const;
/**
* @brief The total number of records available.
*/
void setTotalRecordCount(qint32 newTotalRecordCount);
/**
* @brief The index of the first record in Items.
*/
Q_PROPERTY(qint32 startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)
QList<BaseItemDto *> items() const;
void setItems(QList<BaseItemDto *> newItems);
qint32 totalRecordCount() const;
void setTotalRecordCount(qint32 newTotalRecordCount);
qint32 startIndex() const;
/**
* @brief The index of the first record in Items.
*/
void setStartIndex(qint32 newStartIndex);
signals:
void itemsChanged(QList<BaseItemDto *> newItems);
void totalRecordCountChanged(qint32 newTotalRecordCount);
void startIndexChanged(qint32 newStartIndex);
protected:
QList<BaseItemDto *> m_items;
QList<QSharedPointer<BaseItemDto>> m_items;
qint32 m_totalRecordCount;
qint32 m_startIndex;
};
} // NS DTO
namespace Support {
using BaseItemDtoQueryResult = Jellyfin::DTO::BaseItemDtoQueryResult;
template <>
BaseItemDtoQueryResult fromJsonValue<BaseItemDtoQueryResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BaseItemDtoQueryResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,70 +31,73 @@
#define JELLYFIN_DTO_BASEITEMPERSON_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BaseItemPerson : public QObject {
Q_OBJECT
public:
explicit BaseItemPerson(QObject *parent = nullptr);
static BaseItemPerson *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class BaseItemPerson {
public:
explicit BaseItemPerson();
static BaseItemPerson fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(QString newJellyfinId);
/**
* @brief Gets or sets the role.
*/
Q_PROPERTY(QString role READ role WRITE setRole NOTIFY roleChanged)
QString role() const;
/**
* @brief Gets or sets the role.
*/
void setRole(QString newRole);
/**
* @brief Gets or sets the type.
*/
Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
QString type() const;
/**
* @brief Gets or sets the type.
*/
void setType(QString newType);
/**
* @brief Gets or sets the primary image tag.
*/
Q_PROPERTY(QString primaryImageTag READ primaryImageTag WRITE setPrimaryImageTag NOTIFY primaryImageTagChanged)
QString primaryImageTag() const;
/**
* @brief Gets or sets the primary image tag.
*/
void setPrimaryImageTag(QString newPrimaryImageTag);
/**
* @brief Gets or sets the primary image blurhash.
*/
Q_PROPERTY(QJsonObject imageBlurHashes READ imageBlurHashes WRITE setImageBlurHashes NOTIFY imageBlurHashesChanged)
QString name() const;
void setName(QString newName);
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
QString role() const;
void setRole(QString newRole);
QString type() const;
void setType(QString newType);
QString primaryImageTag() const;
void setPrimaryImageTag(QString newPrimaryImageTag);
QJsonObject imageBlurHashes() const;
/**
* @brief Gets or sets the primary image blurhash.
*/
void setImageBlurHashes(QJsonObject newImageBlurHashes);
signals:
void nameChanged(QString newName);
void jellyfinIdChanged(QString newJellyfinId);
void roleChanged(QString newRole);
void typeChanged(QString newType);
void primaryImageTagChanged(QString newPrimaryImageTag);
void imageBlurHashesChanged(QJsonObject newImageBlurHashes);
protected:
QString m_name;
QString m_jellyfinId;
@ -104,6 +107,18 @@ protected:
QJsonObject m_imageBlurHashes;
};
} // NS DTO
namespace Support {
using BaseItemPerson = Jellyfin::DTO::BaseItemPerson;
template <>
BaseItemPerson fromJsonValue<BaseItemPerson>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BaseItemPerson::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,95 +32,93 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BookInfo : public QObject {
Q_OBJECT
public:
explicit BookInfo(QObject *parent = nullptr);
static BookInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class BookInfo {
public:
explicit BookInfo();
static BookInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
/**
* @brief Gets or sets the metadata language.
*/
Q_PROPERTY(QString metadataLanguage READ metadataLanguage WRITE setMetadataLanguage NOTIFY metadataLanguageChanged)
QString metadataLanguage() const;
/**
* @brief Gets or sets the metadata language.
*/
void setMetadataLanguage(QString newMetadataLanguage);
/**
* @brief Gets or sets the metadata country code.
*/
Q_PROPERTY(QString metadataCountryCode READ metadataCountryCode WRITE setMetadataCountryCode NOTIFY metadataCountryCodeChanged)
QString metadataCountryCode() const;
/**
* @brief Gets or sets the metadata country code.
*/
void setMetadataCountryCode(QString newMetadataCountryCode);
/**
* @brief Gets or sets the provider ids.
*/
Q_PROPERTY(QJsonObject providerIds READ providerIds WRITE setProviderIds NOTIFY providerIdsChanged)
QJsonObject providerIds() const;
/**
* @brief Gets or sets the provider ids.
*/
void setProviderIds(QJsonObject newProviderIds);
/**
* @brief Gets or sets the year.
*/
Q_PROPERTY(qint32 year READ year WRITE setYear NOTIFY yearChanged)
Q_PROPERTY(qint32 indexNumber READ indexNumber WRITE setIndexNumber NOTIFY indexNumberChanged)
Q_PROPERTY(qint32 parentIndexNumber READ parentIndexNumber WRITE setParentIndexNumber NOTIFY parentIndexNumberChanged)
Q_PROPERTY(QDateTime premiereDate READ premiereDate WRITE setPremiereDate NOTIFY premiereDateChanged)
Q_PROPERTY(bool isAutomated READ isAutomated WRITE setIsAutomated NOTIFY isAutomatedChanged)
Q_PROPERTY(QString seriesName READ seriesName WRITE setSeriesName NOTIFY seriesNameChanged)
QString name() const;
void setName(QString newName);
QString path() const;
void setPath(QString newPath);
QString metadataLanguage() const;
void setMetadataLanguage(QString newMetadataLanguage);
QString metadataCountryCode() const;
void setMetadataCountryCode(QString newMetadataCountryCode);
QJsonObject providerIds() const;
void setProviderIds(QJsonObject newProviderIds);
qint32 year() const;
/**
* @brief Gets or sets the year.
*/
void setYear(qint32 newYear);
qint32 indexNumber() const;
void setIndexNumber(qint32 newIndexNumber);
qint32 parentIndexNumber() const;
void setParentIndexNumber(qint32 newParentIndexNumber);
QDateTime premiereDate() const;
void setPremiereDate(QDateTime newPremiereDate);
bool isAutomated() const;
void setIsAutomated(bool newIsAutomated);
QString seriesName() const;
void setSeriesName(QString newSeriesName);
signals:
void nameChanged(QString newName);
void pathChanged(QString newPath);
void metadataLanguageChanged(QString newMetadataLanguage);
void metadataCountryCodeChanged(QString newMetadataCountryCode);
void providerIdsChanged(QJsonObject newProviderIds);
void yearChanged(qint32 newYear);
void indexNumberChanged(qint32 newIndexNumber);
void parentIndexNumberChanged(qint32 newParentIndexNumber);
void premiereDateChanged(QDateTime newPremiereDate);
void isAutomatedChanged(bool newIsAutomated);
void seriesNameChanged(QString newSeriesName);
protected:
QString m_name;
QString m_path;
@ -135,6 +133,18 @@ protected:
QString m_seriesName;
};
} // NS DTO
namespace Support {
using BookInfo = Jellyfin::DTO::BookInfo;
template <>
BookInfo fromJsonValue<BookInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BookInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,57 +31,71 @@
#define JELLYFIN_DTO_BOOKINFOREMOTESEARCHQUERY_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/bookinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BookInfo;
class BookInfoRemoteSearchQuery : public QObject {
Q_OBJECT
class BookInfoRemoteSearchQuery {
public:
explicit BookInfoRemoteSearchQuery(QObject *parent = nullptr);
static BookInfoRemoteSearchQuery *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit BookInfoRemoteSearchQuery();
static BookInfoRemoteSearchQuery fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(BookInfo * searchInfo READ searchInfo WRITE setSearchInfo NOTIFY searchInfoChanged)
Q_PROPERTY(QString itemId READ itemId WRITE setItemId NOTIFY itemIdChanged)
// Properties
QSharedPointer<BookInfo> searchInfo() const;
void setSearchInfo(QSharedPointer<BookInfo> newSearchInfo);
QUuid itemId() const;
void setItemId(QUuid newItemId);
/**
* @brief Will only search within the given provider when set.
*/
Q_PROPERTY(QString searchProviderName READ searchProviderName WRITE setSearchProviderName NOTIFY searchProviderNameChanged)
QString searchProviderName() const;
/**
* @brief Will only search within the given provider when set.
*/
void setSearchProviderName(QString newSearchProviderName);
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
Q_PROPERTY(bool includeDisabledProviders READ includeDisabledProviders WRITE setIncludeDisabledProviders NOTIFY includeDisabledProvidersChanged)
BookInfo * searchInfo() const;
void setSearchInfo(BookInfo * newSearchInfo);
QString itemId() const;
void setItemId(QString newItemId);
QString searchProviderName() const;
void setSearchProviderName(QString newSearchProviderName);
bool includeDisabledProviders() const;
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
void setIncludeDisabledProviders(bool newIncludeDisabledProviders);
signals:
void searchInfoChanged(BookInfo * newSearchInfo);
void itemIdChanged(QString newItemId);
void searchProviderNameChanged(QString newSearchProviderName);
void includeDisabledProvidersChanged(bool newIncludeDisabledProviders);
protected:
BookInfo * m_searchInfo = nullptr;
QString m_itemId;
QSharedPointer<BookInfo> m_searchInfo = nullptr;
QUuid m_itemId;
QString m_searchProviderName;
bool m_includeDisabledProviders;
};
} // NS DTO
namespace Support {
using BookInfoRemoteSearchQuery = Jellyfin::DTO::BookInfoRemoteSearchQuery;
template <>
BookInfoRemoteSearchQuery fromJsonValue<BookInfoRemoteSearchQuery>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BookInfoRemoteSearchQuery::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,90 +32,89 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BoxSetInfo : public QObject {
Q_OBJECT
public:
explicit BoxSetInfo(QObject *parent = nullptr);
static BoxSetInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class BoxSetInfo {
public:
explicit BoxSetInfo();
static BoxSetInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
/**
* @brief Gets or sets the metadata language.
*/
Q_PROPERTY(QString metadataLanguage READ metadataLanguage WRITE setMetadataLanguage NOTIFY metadataLanguageChanged)
QString metadataLanguage() const;
/**
* @brief Gets or sets the metadata language.
*/
void setMetadataLanguage(QString newMetadataLanguage);
/**
* @brief Gets or sets the metadata country code.
*/
Q_PROPERTY(QString metadataCountryCode READ metadataCountryCode WRITE setMetadataCountryCode NOTIFY metadataCountryCodeChanged)
QString metadataCountryCode() const;
/**
* @brief Gets or sets the metadata country code.
*/
void setMetadataCountryCode(QString newMetadataCountryCode);
/**
* @brief Gets or sets the provider ids.
*/
Q_PROPERTY(QJsonObject providerIds READ providerIds WRITE setProviderIds NOTIFY providerIdsChanged)
QJsonObject providerIds() const;
/**
* @brief Gets or sets the provider ids.
*/
void setProviderIds(QJsonObject newProviderIds);
/**
* @brief Gets or sets the year.
*/
Q_PROPERTY(qint32 year READ year WRITE setYear NOTIFY yearChanged)
Q_PROPERTY(qint32 indexNumber READ indexNumber WRITE setIndexNumber NOTIFY indexNumberChanged)
Q_PROPERTY(qint32 parentIndexNumber READ parentIndexNumber WRITE setParentIndexNumber NOTIFY parentIndexNumberChanged)
Q_PROPERTY(QDateTime premiereDate READ premiereDate WRITE setPremiereDate NOTIFY premiereDateChanged)
Q_PROPERTY(bool isAutomated READ isAutomated WRITE setIsAutomated NOTIFY isAutomatedChanged)
QString name() const;
void setName(QString newName);
QString path() const;
void setPath(QString newPath);
QString metadataLanguage() const;
void setMetadataLanguage(QString newMetadataLanguage);
QString metadataCountryCode() const;
void setMetadataCountryCode(QString newMetadataCountryCode);
QJsonObject providerIds() const;
void setProviderIds(QJsonObject newProviderIds);
qint32 year() const;
/**
* @brief Gets or sets the year.
*/
void setYear(qint32 newYear);
qint32 indexNumber() const;
void setIndexNumber(qint32 newIndexNumber);
qint32 parentIndexNumber() const;
void setParentIndexNumber(qint32 newParentIndexNumber);
QDateTime premiereDate() const;
void setPremiereDate(QDateTime newPremiereDate);
bool isAutomated() const;
void setIsAutomated(bool newIsAutomated);
signals:
void nameChanged(QString newName);
void pathChanged(QString newPath);
void metadataLanguageChanged(QString newMetadataLanguage);
void metadataCountryCodeChanged(QString newMetadataCountryCode);
void providerIdsChanged(QJsonObject newProviderIds);
void yearChanged(qint32 newYear);
void indexNumberChanged(qint32 newIndexNumber);
void parentIndexNumberChanged(qint32 newParentIndexNumber);
void premiereDateChanged(QDateTime newPremiereDate);
void isAutomatedChanged(bool newIsAutomated);
protected:
QString m_name;
QString m_path;
@ -129,6 +128,18 @@ protected:
bool m_isAutomated;
};
} // NS DTO
namespace Support {
using BoxSetInfo = Jellyfin::DTO::BoxSetInfo;
template <>
BoxSetInfo fromJsonValue<BoxSetInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BoxSetInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,57 +31,71 @@
#define JELLYFIN_DTO_BOXSETINFOREMOTESEARCHQUERY_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/boxsetinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BoxSetInfo;
class BoxSetInfoRemoteSearchQuery : public QObject {
Q_OBJECT
class BoxSetInfoRemoteSearchQuery {
public:
explicit BoxSetInfoRemoteSearchQuery(QObject *parent = nullptr);
static BoxSetInfoRemoteSearchQuery *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit BoxSetInfoRemoteSearchQuery();
static BoxSetInfoRemoteSearchQuery fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(BoxSetInfo * searchInfo READ searchInfo WRITE setSearchInfo NOTIFY searchInfoChanged)
Q_PROPERTY(QString itemId READ itemId WRITE setItemId NOTIFY itemIdChanged)
// Properties
QSharedPointer<BoxSetInfo> searchInfo() const;
void setSearchInfo(QSharedPointer<BoxSetInfo> newSearchInfo);
QUuid itemId() const;
void setItemId(QUuid newItemId);
/**
* @brief Will only search within the given provider when set.
*/
Q_PROPERTY(QString searchProviderName READ searchProviderName WRITE setSearchProviderName NOTIFY searchProviderNameChanged)
QString searchProviderName() const;
/**
* @brief Will only search within the given provider when set.
*/
void setSearchProviderName(QString newSearchProviderName);
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
Q_PROPERTY(bool includeDisabledProviders READ includeDisabledProviders WRITE setIncludeDisabledProviders NOTIFY includeDisabledProvidersChanged)
BoxSetInfo * searchInfo() const;
void setSearchInfo(BoxSetInfo * newSearchInfo);
QString itemId() const;
void setItemId(QString newItemId);
QString searchProviderName() const;
void setSearchProviderName(QString newSearchProviderName);
bool includeDisabledProviders() const;
/**
* @brief Gets or sets a value indicating whether disabled providers should be included.
*/
void setIncludeDisabledProviders(bool newIncludeDisabledProviders);
signals:
void searchInfoChanged(BoxSetInfo * newSearchInfo);
void itemIdChanged(QString newItemId);
void searchProviderNameChanged(QString newSearchProviderName);
void includeDisabledProvidersChanged(bool newIncludeDisabledProviders);
protected:
BoxSetInfo * m_searchInfo = nullptr;
QString m_itemId;
QSharedPointer<BoxSetInfo> m_searchInfo = nullptr;
QUuid m_itemId;
QString m_searchProviderName;
bool m_includeDisabledProviders;
};
} // NS DTO
namespace Support {
using BoxSetInfoRemoteSearchQuery = Jellyfin::DTO::BoxSetInfoRemoteSearchQuery;
template <>
BoxSetInfoRemoteSearchQuery fromJsonValue<BoxSetInfoRemoteSearchQuery>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BoxSetInfoRemoteSearchQuery::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,43 +31,58 @@
#define JELLYFIN_DTO_BRANDINGOPTIONS_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BrandingOptions : public QObject {
Q_OBJECT
public:
explicit BrandingOptions(QObject *parent = nullptr);
static BrandingOptions *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class BrandingOptions {
public:
explicit BrandingOptions();
static BrandingOptions fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the login disclaimer.
*/
Q_PROPERTY(QString loginDisclaimer READ loginDisclaimer WRITE setLoginDisclaimer NOTIFY loginDisclaimerChanged)
QString loginDisclaimer() const;
/**
* @brief Gets or sets the login disclaimer.
*/
void setLoginDisclaimer(QString newLoginDisclaimer);
/**
* @brief Gets or sets the custom CSS.
*/
Q_PROPERTY(QString customCss READ customCss WRITE setCustomCss NOTIFY customCssChanged)
QString loginDisclaimer() const;
void setLoginDisclaimer(QString newLoginDisclaimer);
QString customCss() const;
/**
* @brief Gets or sets the custom CSS.
*/
void setCustomCss(QString newCustomCss);
signals:
void loginDisclaimerChanged(QString newLoginDisclaimer);
void customCssChanged(QString newCustomCss);
protected:
QString m_loginDisclaimer;
QString m_customCss;
};
} // NS DTO
namespace Support {
using BrandingOptions = Jellyfin::DTO::BrandingOptions;
template <>
BrandingOptions fromJsonValue<BrandingOptions>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BrandingOptions::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,61 +32,76 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QString>
#include <QJsonValue>
#include <QUuid>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class BufferRequestDto : public QObject {
Q_OBJECT
public:
explicit BufferRequestDto(QObject *parent = nullptr);
static BufferRequestDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class BufferRequestDto {
public:
explicit BufferRequestDto();
static BufferRequestDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets when the request has been made by the client.
*/
Q_PROPERTY(QDateTime when READ when WRITE setWhen NOTIFY whenChanged)
QDateTime when() const;
/**
* @brief Gets or sets when the request has been made by the client.
*/
void setWhen(QDateTime newWhen);
/**
* @brief Gets or sets the position ticks.
*/
Q_PROPERTY(qint64 positionTicks READ positionTicks WRITE setPositionTicks NOTIFY positionTicksChanged)
qint64 positionTicks() const;
/**
* @brief Gets or sets the position ticks.
*/
void setPositionTicks(qint64 newPositionTicks);
/**
* @brief Gets or sets a value indicating whether the client playback is unpaused.
*/
Q_PROPERTY(bool isPlaying READ isPlaying WRITE setIsPlaying NOTIFY isPlayingChanged)
bool isPlaying() const;
/**
* @brief Gets or sets a value indicating whether the client playback is unpaused.
*/
void setIsPlaying(bool newIsPlaying);
/**
* @brief Gets or sets the playlist item identifier of the playing item.
*/
Q_PROPERTY(QString playlistItemId READ playlistItemId WRITE setPlaylistItemId NOTIFY playlistItemIdChanged)
QUuid playlistItemId() const;
/**
* @brief Gets or sets the playlist item identifier of the playing item.
*/
void setPlaylistItemId(QUuid newPlaylistItemId);
QDateTime when() const;
void setWhen(QDateTime newWhen);
qint64 positionTicks() const;
void setPositionTicks(qint64 newPositionTicks);
bool isPlaying() const;
void setIsPlaying(bool newIsPlaying);
QString playlistItemId() const;
void setPlaylistItemId(QString newPlaylistItemId);
signals:
void whenChanged(QDateTime newWhen);
void positionTicksChanged(qint64 newPositionTicks);
void isPlayingChanged(bool newIsPlaying);
void playlistItemIdChanged(QString newPlaylistItemId);
protected:
QDateTime m_when;
qint64 m_positionTicks;
bool m_isPlaying;
QString m_playlistItemId;
QUuid m_playlistItemId;
};
} // NS DTO
namespace Support {
using BufferRequestDto = Jellyfin::DTO::BufferRequestDto;
template <>
BufferRequestDto fromJsonValue<BufferRequestDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return BufferRequestDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,124 +31,126 @@
#define JELLYFIN_DTO_CHANNELFEATURES_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/channelitemsortfield.h"
#include "JellyfinQt/DTO/channelmediacontenttype.h"
#include "JellyfinQt/DTO/channelmediatype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ChannelFeatures : public QObject {
Q_OBJECT
public:
explicit ChannelFeatures(QObject *parent = nullptr);
static ChannelFeatures *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ChannelFeatures {
public:
explicit ChannelFeatures();
static ChannelFeatures fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(QString newJellyfinId);
/**
* @brief Gets or sets a value indicating whether this instance can search.
*/
Q_PROPERTY(bool canSearch READ canSearch WRITE setCanSearch NOTIFY canSearchChanged)
bool canSearch() const;
/**
* @brief Gets or sets a value indicating whether this instance can search.
*/
void setCanSearch(bool newCanSearch);
/**
* @brief Gets or sets the media types.
*/
Q_PROPERTY(QList<ChannelMediaType> mediaTypes READ mediaTypes WRITE setMediaTypes NOTIFY mediaTypesChanged)
QList<ChannelMediaType> mediaTypes() const;
/**
* @brief Gets or sets the media types.
*/
void setMediaTypes(QList<ChannelMediaType> newMediaTypes);
/**
* @brief Gets or sets the content types.
*/
Q_PROPERTY(QList<ChannelMediaContentType> contentTypes READ contentTypes WRITE setContentTypes NOTIFY contentTypesChanged)
QList<ChannelMediaContentType> contentTypes() const;
/**
* @brief Gets or sets the content types.
*/
void setContentTypes(QList<ChannelMediaContentType> newContentTypes);
/**
* @brief Represents the maximum number of records the channel allows retrieving at a time.
*/
Q_PROPERTY(qint32 maxPageSize READ maxPageSize WRITE setMaxPageSize NOTIFY maxPageSizeChanged)
qint32 maxPageSize() const;
/**
* @brief Represents the maximum number of records the channel allows retrieving at a time.
*/
void setMaxPageSize(qint32 newMaxPageSize);
/**
* @brief Gets or sets the automatic refresh levels.
*/
Q_PROPERTY(qint32 autoRefreshLevels READ autoRefreshLevels WRITE setAutoRefreshLevels NOTIFY autoRefreshLevelsChanged)
qint32 autoRefreshLevels() const;
/**
* @brief Gets or sets the automatic refresh levels.
*/
void setAutoRefreshLevels(qint32 newAutoRefreshLevels);
/**
* @brief Gets or sets the default sort orders.
*/
Q_PROPERTY(QList<ChannelItemSortField> defaultSortFields READ defaultSortFields WRITE setDefaultSortFields NOTIFY defaultSortFieldsChanged)
QList<ChannelItemSortField> defaultSortFields() const;
/**
* @brief Gets or sets the default sort orders.
*/
void setDefaultSortFields(QList<ChannelItemSortField> newDefaultSortFields);
/**
* @brief Indicates if a sort ascending/descending toggle is supported or not.
*/
Q_PROPERTY(bool supportsSortOrderToggle READ supportsSortOrderToggle WRITE setSupportsSortOrderToggle NOTIFY supportsSortOrderToggleChanged)
bool supportsSortOrderToggle() const;
/**
* @brief Indicates if a sort ascending/descending toggle is supported or not.
*/
void setSupportsSortOrderToggle(bool newSupportsSortOrderToggle);
/**
* @brief Gets or sets a value indicating whether [supports latest media].
*/
Q_PROPERTY(bool supportsLatestMedia READ supportsLatestMedia WRITE setSupportsLatestMedia NOTIFY supportsLatestMediaChanged)
bool supportsLatestMedia() const;
/**
* @brief Gets or sets a value indicating whether [supports latest media].
*/
void setSupportsLatestMedia(bool newSupportsLatestMedia);
/**
* @brief Gets or sets a value indicating whether this instance can filter.
*/
Q_PROPERTY(bool canFilter READ canFilter WRITE setCanFilter NOTIFY canFilterChanged)
bool canFilter() const;
/**
* @brief Gets or sets a value indicating whether this instance can filter.
*/
void setCanFilter(bool newCanFilter);
/**
* @brief Gets or sets a value indicating whether [supports content downloading].
*/
Q_PROPERTY(bool supportsContentDownloading READ supportsContentDownloading WRITE setSupportsContentDownloading NOTIFY supportsContentDownloadingChanged)
QString name() const;
void setName(QString newName);
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
bool canSearch() const;
void setCanSearch(bool newCanSearch);
QList<ChannelMediaType> mediaTypes() const;
void setMediaTypes(QList<ChannelMediaType> newMediaTypes);
QList<ChannelMediaContentType> contentTypes() const;
void setContentTypes(QList<ChannelMediaContentType> newContentTypes);
qint32 maxPageSize() const;
void setMaxPageSize(qint32 newMaxPageSize);
qint32 autoRefreshLevels() const;
void setAutoRefreshLevels(qint32 newAutoRefreshLevels);
QList<ChannelItemSortField> defaultSortFields() const;
void setDefaultSortFields(QList<ChannelItemSortField> newDefaultSortFields);
bool supportsSortOrderToggle() const;
void setSupportsSortOrderToggle(bool newSupportsSortOrderToggle);
bool supportsLatestMedia() const;
void setSupportsLatestMedia(bool newSupportsLatestMedia);
bool canFilter() const;
void setCanFilter(bool newCanFilter);
bool supportsContentDownloading() const;
/**
* @brief Gets or sets a value indicating whether [supports content downloading].
*/
void setSupportsContentDownloading(bool newSupportsContentDownloading);
signals:
void nameChanged(QString newName);
void jellyfinIdChanged(QString newJellyfinId);
void canSearchChanged(bool newCanSearch);
void mediaTypesChanged(QList<ChannelMediaType> newMediaTypes);
void contentTypesChanged(QList<ChannelMediaContentType> newContentTypes);
void maxPageSizeChanged(qint32 newMaxPageSize);
void autoRefreshLevelsChanged(qint32 newAutoRefreshLevels);
void defaultSortFieldsChanged(QList<ChannelItemSortField> newDefaultSortFields);
void supportsSortOrderToggleChanged(bool newSupportsSortOrderToggle);
void supportsLatestMediaChanged(bool newSupportsLatestMedia);
void canFilterChanged(bool newCanFilter);
void supportsContentDownloadingChanged(bool newSupportsContentDownloading);
protected:
QString m_name;
QString m_jellyfinId;
@ -164,6 +166,18 @@ protected:
bool m_supportsContentDownloading;
};
} // NS DTO
namespace Support {
using ChannelFeatures = Jellyfin::DTO::ChannelFeatures;
template <>
ChannelFeatures fromJsonValue<ChannelFeatures>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ChannelFeatures::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CHANNELITEMSORTFIELD_H
#define JELLYFIN_DTO_CHANNELITEMSORTFIELD_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ChannelItemSortFieldClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Name,
CommunityRating,
PremiereDate,
@ -51,8 +56,46 @@ public:
private:
explicit ChannelItemSortFieldClass();
};
typedef ChannelItemSortFieldClass::Value ChannelItemSortField;
} // NS DTO
namespace Support {
using ChannelItemSortField = Jellyfin::DTO::ChannelItemSortField;
using ChannelItemSortFieldClass = Jellyfin::DTO::ChannelItemSortFieldClass;
template <>
ChannelItemSortField fromJsonValue<ChannelItemSortField>(const QJsonValue &source) {
if (!source.isString()) return ChannelItemSortFieldClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Name")) {
return ChannelItemSortFieldClass::Name;
}
if (str == QStringLiteral("CommunityRating")) {
return ChannelItemSortFieldClass::CommunityRating;
}
if (str == QStringLiteral("PremiereDate")) {
return ChannelItemSortFieldClass::PremiereDate;
}
if (str == QStringLiteral("DateCreated")) {
return ChannelItemSortFieldClass::DateCreated;
}
if (str == QStringLiteral("Runtime")) {
return ChannelItemSortFieldClass::Runtime;
}
if (str == QStringLiteral("PlayCount")) {
return ChannelItemSortFieldClass::PlayCount;
}
if (str == QStringLiteral("CommunityPlayCount")) {
return ChannelItemSortFieldClass::CommunityPlayCount;
}
return ChannelItemSortFieldClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,67 +31,82 @@
#define JELLYFIN_DTO_CHANNELMAPPINGOPTIONSDTO_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/nameidpair.h"
#include "JellyfinQt/DTO/namevaluepair.h"
#include "JellyfinQt/DTO/tunerchannelmapping.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class NameIdPair;
class NameValuePair;
class TunerChannelMapping;
class ChannelMappingOptionsDto : public QObject {
Q_OBJECT
class ChannelMappingOptionsDto {
public:
explicit ChannelMappingOptionsDto(QObject *parent = nullptr);
static ChannelMappingOptionsDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ChannelMappingOptionsDto();
static ChannelMappingOptionsDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets list of tuner channels.
*/
Q_PROPERTY(QList<TunerChannelMapping *> tunerChannels READ tunerChannels WRITE setTunerChannels NOTIFY tunerChannelsChanged)
QList<QSharedPointer<TunerChannelMapping>> tunerChannels() const;
/**
* @brief Gets or sets list of tuner channels.
*/
void setTunerChannels(QList<QSharedPointer<TunerChannelMapping>> newTunerChannels);
/**
* @brief Gets or sets list of provider channels.
*/
Q_PROPERTY(QList<NameIdPair *> providerChannels READ providerChannels WRITE setProviderChannels NOTIFY providerChannelsChanged)
QList<QSharedPointer<NameIdPair>> providerChannels() const;
/**
* @brief Gets or sets list of provider channels.
*/
void setProviderChannels(QList<QSharedPointer<NameIdPair>> newProviderChannels);
/**
* @brief Gets or sets list of mappings.
*/
Q_PROPERTY(QList<NameValuePair *> mappings READ mappings WRITE setMappings NOTIFY mappingsChanged)
QList<QSharedPointer<NameValuePair>> mappings() const;
/**
* @brief Gets or sets list of mappings.
*/
void setMappings(QList<QSharedPointer<NameValuePair>> newMappings);
/**
* @brief Gets or sets provider name.
*/
Q_PROPERTY(QString providerName READ providerName WRITE setProviderName NOTIFY providerNameChanged)
QList<TunerChannelMapping *> tunerChannels() const;
void setTunerChannels(QList<TunerChannelMapping *> newTunerChannels);
QList<NameIdPair *> providerChannels() const;
void setProviderChannels(QList<NameIdPair *> newProviderChannels);
QList<NameValuePair *> mappings() const;
void setMappings(QList<NameValuePair *> newMappings);
QString providerName() const;
/**
* @brief Gets or sets provider name.
*/
void setProviderName(QString newProviderName);
signals:
void tunerChannelsChanged(QList<TunerChannelMapping *> newTunerChannels);
void providerChannelsChanged(QList<NameIdPair *> newProviderChannels);
void mappingsChanged(QList<NameValuePair *> newMappings);
void providerNameChanged(QString newProviderName);
protected:
QList<TunerChannelMapping *> m_tunerChannels;
QList<NameIdPair *> m_providerChannels;
QList<NameValuePair *> m_mappings;
QList<QSharedPointer<TunerChannelMapping>> m_tunerChannels;
QList<QSharedPointer<NameIdPair>> m_providerChannels;
QList<QSharedPointer<NameValuePair>> m_mappings;
QString m_providerName;
};
} // NS DTO
namespace Support {
using ChannelMappingOptionsDto = Jellyfin::DTO::ChannelMappingOptionsDto;
template <>
ChannelMappingOptionsDto fromJsonValue<ChannelMappingOptionsDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ChannelMappingOptionsDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CHANNELMEDIACONTENTTYPE_H
#define JELLYFIN_DTO_CHANNELMEDIACONTENTTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ChannelMediaContentTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Clip,
Podcast,
Trailer,
@ -52,8 +57,49 @@ public:
private:
explicit ChannelMediaContentTypeClass();
};
typedef ChannelMediaContentTypeClass::Value ChannelMediaContentType;
} // NS DTO
namespace Support {
using ChannelMediaContentType = Jellyfin::DTO::ChannelMediaContentType;
using ChannelMediaContentTypeClass = Jellyfin::DTO::ChannelMediaContentTypeClass;
template <>
ChannelMediaContentType fromJsonValue<ChannelMediaContentType>(const QJsonValue &source) {
if (!source.isString()) return ChannelMediaContentTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Clip")) {
return ChannelMediaContentTypeClass::Clip;
}
if (str == QStringLiteral("Podcast")) {
return ChannelMediaContentTypeClass::Podcast;
}
if (str == QStringLiteral("Trailer")) {
return ChannelMediaContentTypeClass::Trailer;
}
if (str == QStringLiteral("Movie")) {
return ChannelMediaContentTypeClass::Movie;
}
if (str == QStringLiteral("Episode")) {
return ChannelMediaContentTypeClass::Episode;
}
if (str == QStringLiteral("Song")) {
return ChannelMediaContentTypeClass::Song;
}
if (str == QStringLiteral("MovieExtra")) {
return ChannelMediaContentTypeClass::MovieExtra;
}
if (str == QStringLiteral("TvExtra")) {
return ChannelMediaContentTypeClass::TvExtra;
}
return ChannelMediaContentTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CHANNELMEDIATYPE_H
#define JELLYFIN_DTO_CHANNELMEDIATYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ChannelMediaTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Audio,
Video,
Photo,
@ -47,8 +52,34 @@ public:
private:
explicit ChannelMediaTypeClass();
};
typedef ChannelMediaTypeClass::Value ChannelMediaType;
} // NS DTO
namespace Support {
using ChannelMediaType = Jellyfin::DTO::ChannelMediaType;
using ChannelMediaTypeClass = Jellyfin::DTO::ChannelMediaTypeClass;
template <>
ChannelMediaType fromJsonValue<ChannelMediaType>(const QJsonValue &source) {
if (!source.isString()) return ChannelMediaTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Audio")) {
return ChannelMediaTypeClass::Audio;
}
if (str == QStringLiteral("Video")) {
return ChannelMediaTypeClass::Video;
}
if (str == QStringLiteral("Photo")) {
return ChannelMediaTypeClass::Photo;
}
return ChannelMediaTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CHANNELTYPE_H
#define JELLYFIN_DTO_CHANNELTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ChannelTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
TV,
Radio,
};
@ -46,8 +51,31 @@ public:
private:
explicit ChannelTypeClass();
};
typedef ChannelTypeClass::Value ChannelType;
} // NS DTO
namespace Support {
using ChannelType = Jellyfin::DTO::ChannelType;
using ChannelTypeClass = Jellyfin::DTO::ChannelTypeClass;
template <>
ChannelType fromJsonValue<ChannelType>(const QJsonValue &source) {
if (!source.isString()) return ChannelTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("TV")) {
return ChannelTypeClass::TV;
}
if (str == QStringLiteral("Radio")) {
return ChannelTypeClass::Radio;
}
return ChannelTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,56 +32,57 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ChapterInfo : public QObject {
Q_OBJECT
public:
explicit ChapterInfo(QObject *parent = nullptr);
static ChapterInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ChapterInfo {
public:
explicit ChapterInfo();
static ChapterInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the start position ticks.
*/
Q_PROPERTY(qint64 startPositionTicks READ startPositionTicks WRITE setStartPositionTicks NOTIFY startPositionTicksChanged)
qint64 startPositionTicks() const;
/**
* @brief Gets or sets the start position ticks.
*/
void setStartPositionTicks(qint64 newStartPositionTicks);
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the image path.
*/
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
Q_PROPERTY(QDateTime imageDateModified READ imageDateModified WRITE setImageDateModified NOTIFY imageDateModifiedChanged)
Q_PROPERTY(QString imageTag READ imageTag WRITE setImageTag NOTIFY imageTagChanged)
qint64 startPositionTicks() const;
void setStartPositionTicks(qint64 newStartPositionTicks);
QString name() const;
void setName(QString newName);
QString imagePath() const;
/**
* @brief Gets or sets the image path.
*/
void setImagePath(QString newImagePath);
QDateTime imageDateModified() const;
void setImageDateModified(QDateTime newImageDateModified);
QString imageTag() const;
void setImageTag(QString newImageTag);
signals:
void startPositionTicksChanged(qint64 newStartPositionTicks);
void nameChanged(QString newName);
void imagePathChanged(QString newImagePath);
void imageDateModifiedChanged(QDateTime newImageDateModified);
void imageTagChanged(QString newImageTag);
protected:
qint64 m_startPositionTicks;
QString m_name;
@ -90,6 +91,18 @@ protected:
QString m_imageTag;
};
} // NS DTO
namespace Support {
using ChapterInfo = Jellyfin::DTO::ChapterInfo;
template <>
ChapterInfo fromJsonValue<ChapterInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ChapterInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,78 +31,70 @@
#define JELLYFIN_DTO_CLIENTCAPABILITIES_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/deviceprofile.h"
#include "JellyfinQt/DTO/generalcommandtype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DeviceProfile;
class ClientCapabilities : public QObject {
Q_OBJECT
class ClientCapabilities {
public:
explicit ClientCapabilities(QObject *parent = nullptr);
static ClientCapabilities *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ClientCapabilities();
static ClientCapabilities fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(QStringList playableMediaTypes READ playableMediaTypes WRITE setPlayableMediaTypes NOTIFY playableMediaTypesChanged)
Q_PROPERTY(QList<GeneralCommandType> supportedCommands READ supportedCommands WRITE setSupportedCommands NOTIFY supportedCommandsChanged)
Q_PROPERTY(bool supportsMediaControl READ supportsMediaControl WRITE setSupportsMediaControl NOTIFY supportsMediaControlChanged)
Q_PROPERTY(bool supportsContentUploading READ supportsContentUploading WRITE setSupportsContentUploading NOTIFY supportsContentUploadingChanged)
Q_PROPERTY(QString messageCallbackUrl READ messageCallbackUrl WRITE setMessageCallbackUrl NOTIFY messageCallbackUrlChanged)
Q_PROPERTY(bool supportsPersistentIdentifier READ supportsPersistentIdentifier WRITE setSupportsPersistentIdentifier NOTIFY supportsPersistentIdentifierChanged)
Q_PROPERTY(bool supportsSync READ supportsSync WRITE setSupportsSync NOTIFY supportsSyncChanged)
Q_PROPERTY(DeviceProfile * deviceProfile READ deviceProfile WRITE setDeviceProfile NOTIFY deviceProfileChanged)
Q_PROPERTY(QString appStoreUrl READ appStoreUrl WRITE setAppStoreUrl NOTIFY appStoreUrlChanged)
Q_PROPERTY(QString iconUrl READ iconUrl WRITE setIconUrl NOTIFY iconUrlChanged)
// Properties
QStringList playableMediaTypes() const;
void setPlayableMediaTypes(QStringList newPlayableMediaTypes);
QList<GeneralCommandType> supportedCommands() const;
void setSupportedCommands(QList<GeneralCommandType> newSupportedCommands);
bool supportsMediaControl() const;
void setSupportsMediaControl(bool newSupportsMediaControl);
bool supportsContentUploading() const;
void setSupportsContentUploading(bool newSupportsContentUploading);
QString messageCallbackUrl() const;
void setMessageCallbackUrl(QString newMessageCallbackUrl);
bool supportsPersistentIdentifier() const;
void setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier);
bool supportsSync() const;
void setSupportsSync(bool newSupportsSync);
DeviceProfile * deviceProfile() const;
void setDeviceProfile(DeviceProfile * newDeviceProfile);
QSharedPointer<DeviceProfile> deviceProfile() const;
void setDeviceProfile(QSharedPointer<DeviceProfile> newDeviceProfile);
QString appStoreUrl() const;
void setAppStoreUrl(QString newAppStoreUrl);
QString iconUrl() const;
void setIconUrl(QString newIconUrl);
signals:
void playableMediaTypesChanged(QStringList newPlayableMediaTypes);
void supportedCommandsChanged(QList<GeneralCommandType> newSupportedCommands);
void supportsMediaControlChanged(bool newSupportsMediaControl);
void supportsContentUploadingChanged(bool newSupportsContentUploading);
void messageCallbackUrlChanged(QString newMessageCallbackUrl);
void supportsPersistentIdentifierChanged(bool newSupportsPersistentIdentifier);
void supportsSyncChanged(bool newSupportsSync);
void deviceProfileChanged(DeviceProfile * newDeviceProfile);
void appStoreUrlChanged(QString newAppStoreUrl);
void iconUrlChanged(QString newIconUrl);
protected:
QStringList m_playableMediaTypes;
QList<GeneralCommandType> m_supportedCommands;
@ -111,11 +103,23 @@ protected:
QString m_messageCallbackUrl;
bool m_supportsPersistentIdentifier;
bool m_supportsSync;
DeviceProfile * m_deviceProfile = nullptr;
QSharedPointer<DeviceProfile> m_deviceProfile = nullptr;
QString m_appStoreUrl;
QString m_iconUrl;
};
} // NS DTO
namespace Support {
using ClientCapabilities = Jellyfin::DTO::ClientCapabilities;
template <>
ClientCapabilities fromJsonValue<ClientCapabilities>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ClientCapabilities::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,105 +31,106 @@
#define JELLYFIN_DTO_CLIENTCAPABILITIESDTO_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/deviceprofile.h"
#include "JellyfinQt/DTO/generalcommandtype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DeviceProfile;
class ClientCapabilitiesDto : public QObject {
Q_OBJECT
class ClientCapabilitiesDto {
public:
explicit ClientCapabilitiesDto(QObject *parent = nullptr);
static ClientCapabilitiesDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ClientCapabilitiesDto();
static ClientCapabilitiesDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the list of playable media types.
*/
Q_PROPERTY(QStringList playableMediaTypes READ playableMediaTypes WRITE setPlayableMediaTypes NOTIFY playableMediaTypesChanged)
QStringList playableMediaTypes() const;
/**
* @brief Gets or sets the list of playable media types.
*/
void setPlayableMediaTypes(QStringList newPlayableMediaTypes);
/**
* @brief Gets or sets the list of supported commands.
*/
Q_PROPERTY(QList<GeneralCommandType> supportedCommands READ supportedCommands WRITE setSupportedCommands NOTIFY supportedCommandsChanged)
QList<GeneralCommandType> supportedCommands() const;
/**
* @brief Gets or sets the list of supported commands.
*/
void setSupportedCommands(QList<GeneralCommandType> newSupportedCommands);
/**
* @brief Gets or sets a value indicating whether session supports media control.
*/
Q_PROPERTY(bool supportsMediaControl READ supportsMediaControl WRITE setSupportsMediaControl NOTIFY supportsMediaControlChanged)
bool supportsMediaControl() const;
/**
* @brief Gets or sets a value indicating whether session supports media control.
*/
void setSupportsMediaControl(bool newSupportsMediaControl);
/**
* @brief Gets or sets a value indicating whether session supports content uploading.
*/
Q_PROPERTY(bool supportsContentUploading READ supportsContentUploading WRITE setSupportsContentUploading NOTIFY supportsContentUploadingChanged)
bool supportsContentUploading() const;
/**
* @brief Gets or sets a value indicating whether session supports content uploading.
*/
void setSupportsContentUploading(bool newSupportsContentUploading);
/**
* @brief Gets or sets the message callback url.
*/
Q_PROPERTY(QString messageCallbackUrl READ messageCallbackUrl WRITE setMessageCallbackUrl NOTIFY messageCallbackUrlChanged)
QString messageCallbackUrl() const;
/**
* @brief Gets or sets the message callback url.
*/
void setMessageCallbackUrl(QString newMessageCallbackUrl);
/**
* @brief Gets or sets a value indicating whether session supports a persistent identifier.
*/
Q_PROPERTY(bool supportsPersistentIdentifier READ supportsPersistentIdentifier WRITE setSupportsPersistentIdentifier NOTIFY supportsPersistentIdentifierChanged)
bool supportsPersistentIdentifier() const;
/**
* @brief Gets or sets a value indicating whether session supports a persistent identifier.
*/
void setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier);
/**
* @brief Gets or sets a value indicating whether session supports sync.
*/
Q_PROPERTY(bool supportsSync READ supportsSync WRITE setSupportsSync NOTIFY supportsSyncChanged)
Q_PROPERTY(DeviceProfile * deviceProfile READ deviceProfile WRITE setDeviceProfile NOTIFY deviceProfileChanged)
bool supportsSync() const;
/**
* @brief Gets or sets a value indicating whether session supports sync.
*/
void setSupportsSync(bool newSupportsSync);
QSharedPointer<DeviceProfile> deviceProfile() const;
void setDeviceProfile(QSharedPointer<DeviceProfile> newDeviceProfile);
/**
* @brief Gets or sets the app store url.
*/
Q_PROPERTY(QString appStoreUrl READ appStoreUrl WRITE setAppStoreUrl NOTIFY appStoreUrlChanged)
QString appStoreUrl() const;
/**
* @brief Gets or sets the app store url.
*/
void setAppStoreUrl(QString newAppStoreUrl);
/**
* @brief Gets or sets the icon url.
*/
Q_PROPERTY(QString iconUrl READ iconUrl WRITE setIconUrl NOTIFY iconUrlChanged)
QStringList playableMediaTypes() const;
void setPlayableMediaTypes(QStringList newPlayableMediaTypes);
QList<GeneralCommandType> supportedCommands() const;
void setSupportedCommands(QList<GeneralCommandType> newSupportedCommands);
bool supportsMediaControl() const;
void setSupportsMediaControl(bool newSupportsMediaControl);
bool supportsContentUploading() const;
void setSupportsContentUploading(bool newSupportsContentUploading);
QString messageCallbackUrl() const;
void setMessageCallbackUrl(QString newMessageCallbackUrl);
bool supportsPersistentIdentifier() const;
void setSupportsPersistentIdentifier(bool newSupportsPersistentIdentifier);
bool supportsSync() const;
void setSupportsSync(bool newSupportsSync);
DeviceProfile * deviceProfile() const;
void setDeviceProfile(DeviceProfile * newDeviceProfile);
QString appStoreUrl() const;
void setAppStoreUrl(QString newAppStoreUrl);
QString iconUrl() const;
/**
* @brief Gets or sets the icon url.
*/
void setIconUrl(QString newIconUrl);
signals:
void playableMediaTypesChanged(QStringList newPlayableMediaTypes);
void supportedCommandsChanged(QList<GeneralCommandType> newSupportedCommands);
void supportsMediaControlChanged(bool newSupportsMediaControl);
void supportsContentUploadingChanged(bool newSupportsContentUploading);
void messageCallbackUrlChanged(QString newMessageCallbackUrl);
void supportsPersistentIdentifierChanged(bool newSupportsPersistentIdentifier);
void supportsSyncChanged(bool newSupportsSync);
void deviceProfileChanged(DeviceProfile * newDeviceProfile);
void appStoreUrlChanged(QString newAppStoreUrl);
void iconUrlChanged(QString newIconUrl);
protected:
QStringList m_playableMediaTypes;
QList<GeneralCommandType> m_supportedCommands;
@ -138,11 +139,23 @@ protected:
QString m_messageCallbackUrl;
bool m_supportsPersistentIdentifier;
bool m_supportsSync;
DeviceProfile * m_deviceProfile = nullptr;
QSharedPointer<DeviceProfile> m_deviceProfile = nullptr;
QString m_appStoreUrl;
QString m_iconUrl;
};
} // NS DTO
namespace Support {
using ClientCapabilitiesDto = Jellyfin::DTO::ClientCapabilitiesDto;
template <>
ClientCapabilitiesDto fromJsonValue<ClientCapabilitiesDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ClientCapabilitiesDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,62 +31,70 @@
#define JELLYFIN_DTO_CODECPROFILE_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/codectype.h"
#include "JellyfinQt/DTO/profilecondition.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ProfileCondition;
class ProfileCondition;
class CodecProfile : public QObject {
Q_OBJECT
class CodecProfile {
public:
explicit CodecProfile(QObject *parent = nullptr);
static CodecProfile *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit CodecProfile();
static CodecProfile fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(CodecType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(QList<ProfileCondition *> conditions READ conditions WRITE setConditions NOTIFY conditionsChanged)
Q_PROPERTY(QList<ProfileCondition *> applyConditions READ applyConditions WRITE setApplyConditions NOTIFY applyConditionsChanged)
Q_PROPERTY(QString codec READ codec WRITE setCodec NOTIFY codecChanged)
Q_PROPERTY(QString container READ container WRITE setContainer NOTIFY containerChanged)
// Properties
CodecType type() const;
void setType(CodecType newType);
QList<ProfileCondition *> conditions() const;
void setConditions(QList<ProfileCondition *> newConditions);
QList<QSharedPointer<ProfileCondition>> conditions() const;
QList<ProfileCondition *> applyConditions() const;
void setApplyConditions(QList<ProfileCondition *> newApplyConditions);
void setConditions(QList<QSharedPointer<ProfileCondition>> newConditions);
QList<QSharedPointer<ProfileCondition>> applyConditions() const;
void setApplyConditions(QList<QSharedPointer<ProfileCondition>> newApplyConditions);
QString codec() const;
void setCodec(QString newCodec);
QString container() const;
void setContainer(QString newContainer);
signals:
void typeChanged(CodecType newType);
void conditionsChanged(QList<ProfileCondition *> newConditions);
void applyConditionsChanged(QList<ProfileCondition *> newApplyConditions);
void codecChanged(QString newCodec);
void containerChanged(QString newContainer);
protected:
CodecType m_type;
QList<ProfileCondition *> m_conditions;
QList<ProfileCondition *> m_applyConditions;
QList<QSharedPointer<ProfileCondition>> m_conditions;
QList<QSharedPointer<ProfileCondition>> m_applyConditions;
QString m_codec;
QString m_container;
};
} // NS DTO
namespace Support {
using CodecProfile = Jellyfin::DTO::CodecProfile;
template <>
CodecProfile fromJsonValue<CodecProfile>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CodecProfile::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CODECTYPE_H
#define JELLYFIN_DTO_CODECTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class CodecTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Video,
VideoAudio,
Audio,
@ -47,8 +52,34 @@ public:
private:
explicit CodecTypeClass();
};
typedef CodecTypeClass::Value CodecType;
} // NS DTO
namespace Support {
using CodecType = Jellyfin::DTO::CodecType;
using CodecTypeClass = Jellyfin::DTO::CodecTypeClass;
template <>
CodecType fromJsonValue<CodecType>(const QJsonValue &source) {
if (!source.isString()) return CodecTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Video")) {
return CodecTypeClass::Video;
}
if (str == QStringLiteral("VideoAudio")) {
return CodecTypeClass::VideoAudio;
}
if (str == QStringLiteral("Audio")) {
return CodecTypeClass::Audio;
}
return CodecTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,31 +31,45 @@
#define JELLYFIN_DTO_COLLECTIONCREATIONRESULT_H
#include <QJsonObject>
#include <QObject>
#include <QString>
#include <QJsonValue>
#include <QUuid>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CollectionCreationResult : public QObject {
Q_OBJECT
class CollectionCreationResult {
public:
explicit CollectionCreationResult(QObject *parent = nullptr);
static CollectionCreationResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit CollectionCreationResult();
static CollectionCreationResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
// Properties
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
QUuid jellyfinId() const;
void setJellyfinId(QUuid newJellyfinId);
signals:
void jellyfinIdChanged(QString newJellyfinId);
protected:
QString m_jellyfinId;
QUuid m_jellyfinId;
};
} // NS DTO
namespace Support {
using CollectionCreationResult = Jellyfin::DTO::CollectionCreationResult;
template <>
CollectionCreationResult fromJsonValue<CollectionCreationResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CollectionCreationResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,77 +31,79 @@
#define JELLYFIN_DTO_CONFIGURATIONPAGEINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/configurationpagetype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ConfigurationPageInfo : public QObject {
Q_OBJECT
public:
explicit ConfigurationPageInfo(QObject *parent = nullptr);
static ConfigurationPageInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ConfigurationPageInfo {
public:
explicit ConfigurationPageInfo();
static ConfigurationPageInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets a value indicating whether the configurations page is enabled in the main menu.
*/
Q_PROPERTY(bool enableInMainMenu READ enableInMainMenu WRITE setEnableInMainMenu NOTIFY enableInMainMenuChanged)
bool enableInMainMenu() const;
/**
* @brief Gets or sets a value indicating whether the configurations page is enabled in the main menu.
*/
void setEnableInMainMenu(bool newEnableInMainMenu);
/**
* @brief Gets or sets the menu section.
*/
Q_PROPERTY(QString menuSection READ menuSection WRITE setMenuSection NOTIFY menuSectionChanged)
QString menuSection() const;
/**
* @brief Gets or sets the menu section.
*/
void setMenuSection(QString newMenuSection);
/**
* @brief Gets or sets the menu icon.
*/
Q_PROPERTY(QString menuIcon READ menuIcon WRITE setMenuIcon NOTIFY menuIconChanged)
QString menuIcon() const;
/**
* @brief Gets or sets the menu icon.
*/
void setMenuIcon(QString newMenuIcon);
/**
* @brief Gets or sets the display name.
*/
Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
Q_PROPERTY(ConfigurationPageType configurationPageType READ configurationPageType WRITE setConfigurationPageType NOTIFY configurationPageTypeChanged)
/**
* @brief Gets or sets the plugin id.
*/
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId NOTIFY pluginIdChanged)
QString name() const;
void setName(QString newName);
bool enableInMainMenu() const;
void setEnableInMainMenu(bool newEnableInMainMenu);
QString menuSection() const;
void setMenuSection(QString newMenuSection);
QString menuIcon() const;
void setMenuIcon(QString newMenuIcon);
QString displayName() const;
/**
* @brief Gets or sets the display name.
*/
void setDisplayName(QString newDisplayName);
ConfigurationPageType configurationPageType() const;
void setConfigurationPageType(ConfigurationPageType newConfigurationPageType);
/**
* @brief Gets or sets the plugin id.
*/
QUuid pluginId() const;
/**
* @brief Gets or sets the plugin id.
*/
void setPluginId(QUuid newPluginId);
QString pluginId() const;
void setPluginId(QString newPluginId);
signals:
void nameChanged(QString newName);
void enableInMainMenuChanged(bool newEnableInMainMenu);
void menuSectionChanged(QString newMenuSection);
void menuIconChanged(QString newMenuIcon);
void displayNameChanged(QString newDisplayName);
void configurationPageTypeChanged(ConfigurationPageType newConfigurationPageType);
void pluginIdChanged(QString newPluginId);
protected:
QString m_name;
bool m_enableInMainMenu;
@ -109,9 +111,21 @@ protected:
QString m_menuIcon;
QString m_displayName;
ConfigurationPageType m_configurationPageType;
QString m_pluginId;
QUuid m_pluginId;
};
} // NS DTO
namespace Support {
using ConfigurationPageInfo = Jellyfin::DTO::ConfigurationPageInfo;
template <>
ConfigurationPageInfo fromJsonValue<ConfigurationPageInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ConfigurationPageInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_CONFIGURATIONPAGETYPE_H
#define JELLYFIN_DTO_CONFIGURATIONPAGETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ConfigurationPageTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
PluginConfiguration,
None,
};
@ -46,8 +51,31 @@ public:
private:
explicit ConfigurationPageTypeClass();
};
typedef ConfigurationPageTypeClass::Value ConfigurationPageType;
} // NS DTO
namespace Support {
using ConfigurationPageType = Jellyfin::DTO::ConfigurationPageType;
using ConfigurationPageTypeClass = Jellyfin::DTO::ConfigurationPageTypeClass;
template <>
ConfigurationPageType fromJsonValue<ConfigurationPageType>(const QJsonValue &source) {
if (!source.isString()) return ConfigurationPageTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("PluginConfiguration")) {
return ConfigurationPageTypeClass::PluginConfiguration;
}
if (str == QStringLiteral("None")) {
return ConfigurationPageTypeClass::None;
}
return ConfigurationPageTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,49 +31,60 @@
#define JELLYFIN_DTO_CONTAINERPROFILE_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/dlnaprofiletype.h"
#include "JellyfinQt/DTO/profilecondition.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ProfileCondition;
class ContainerProfile : public QObject {
Q_OBJECT
class ContainerProfile {
public:
explicit ContainerProfile(QObject *parent = nullptr);
static ContainerProfile *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit ContainerProfile();
static ContainerProfile fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(DlnaProfileType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(QList<ProfileCondition *> conditions READ conditions WRITE setConditions NOTIFY conditionsChanged)
Q_PROPERTY(QString container READ container WRITE setContainer NOTIFY containerChanged)
// Properties
DlnaProfileType type() const;
void setType(DlnaProfileType newType);
QList<ProfileCondition *> conditions() const;
void setConditions(QList<ProfileCondition *> newConditions);
QList<QSharedPointer<ProfileCondition>> conditions() const;
void setConditions(QList<QSharedPointer<ProfileCondition>> newConditions);
QString container() const;
void setContainer(QString newContainer);
signals:
void typeChanged(DlnaProfileType newType);
void conditionsChanged(QList<ProfileCondition *> newConditions);
void containerChanged(QString newContainer);
protected:
DlnaProfileType m_type;
QList<ProfileCondition *> m_conditions;
QList<QSharedPointer<ProfileCondition>> m_conditions;
QString m_container;
};
} // NS DTO
namespace Support {
using ContainerProfile = Jellyfin::DTO::ContainerProfile;
template <>
ContainerProfile fromJsonValue<ContainerProfile>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ContainerProfile::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,43 +31,55 @@
#define JELLYFIN_DTO_CONTROLRESPONSE_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ControlResponse : public QObject {
Q_OBJECT
public:
explicit ControlResponse(QObject *parent = nullptr);
static ControlResponse *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(QJsonObject headers READ headers WRITE setHeaders NOTIFY headersChanged)
Q_PROPERTY(QString xml READ xml WRITE setXml NOTIFY xmlChanged)
Q_PROPERTY(bool isSuccessful READ isSuccessful WRITE setIsSuccessful NOTIFY isSuccessfulChanged)
class ControlResponse {
public:
explicit ControlResponse();
static ControlResponse fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
QJsonObject headers() const;
void setHeaders(QJsonObject newHeaders);
QString xml() const;
void setXml(QString newXml);
bool isSuccessful() const;
void setIsSuccessful(bool newIsSuccessful);
signals:
void headersChanged(QJsonObject newHeaders);
void xmlChanged(QString newXml);
void isSuccessfulChanged(bool newIsSuccessful);
protected:
QJsonObject m_headers;
QString m_xml;
bool m_isSuccessful;
};
} // NS DTO
namespace Support {
using ControlResponse = Jellyfin::DTO::ControlResponse;
template <>
ControlResponse fromJsonValue<ControlResponse>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ControlResponse::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,54 +31,57 @@
#define JELLYFIN_DTO_COUNTRYINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CountryInfo : public QObject {
Q_OBJECT
public:
explicit CountryInfo(QObject *parent = nullptr);
static CountryInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class CountryInfo {
public:
explicit CountryInfo();
static CountryInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the display name.
*/
Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
QString displayName() const;
/**
* @brief Gets or sets the display name.
*/
void setDisplayName(QString newDisplayName);
/**
* @brief Gets or sets the name of the two letter ISO region.
*/
Q_PROPERTY(QString twoLetterISORegionName READ twoLetterISORegionName WRITE setTwoLetterISORegionName NOTIFY twoLetterISORegionNameChanged)
QString twoLetterISORegionName() const;
/**
* @brief Gets or sets the name of the two letter ISO region.
*/
void setTwoLetterISORegionName(QString newTwoLetterISORegionName);
/**
* @brief Gets or sets the name of the three letter ISO region.
*/
Q_PROPERTY(QString threeLetterISORegionName READ threeLetterISORegionName WRITE setThreeLetterISORegionName NOTIFY threeLetterISORegionNameChanged)
QString name() const;
void setName(QString newName);
QString displayName() const;
void setDisplayName(QString newDisplayName);
QString twoLetterISORegionName() const;
void setTwoLetterISORegionName(QString newTwoLetterISORegionName);
QString threeLetterISORegionName() const;
/**
* @brief Gets or sets the name of the three letter ISO region.
*/
void setThreeLetterISORegionName(QString newThreeLetterISORegionName);
signals:
void nameChanged(QString newName);
void displayNameChanged(QString newDisplayName);
void twoLetterISORegionNameChanged(QString newTwoLetterISORegionName);
void threeLetterISORegionNameChanged(QString newThreeLetterISORegionName);
protected:
QString m_name;
QString m_displayName;
@ -86,6 +89,18 @@ protected:
QString m_threeLetterISORegionName;
};
} // NS DTO
namespace Support {
using CountryInfo = Jellyfin::DTO::CountryInfo;
template <>
CountryInfo fromJsonValue<CountryInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CountryInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,63 +31,79 @@
#define JELLYFIN_DTO_CREATEPLAYLISTDTO_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QUuid>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CreatePlaylistDto : public QObject {
Q_OBJECT
public:
explicit CreatePlaylistDto(QObject *parent = nullptr);
static CreatePlaylistDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class CreatePlaylistDto {
public:
explicit CreatePlaylistDto();
static CreatePlaylistDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name of the new playlist.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name of the new playlist.
*/
void setName(QString newName);
/**
* @brief Gets or sets item ids to add to the playlist.
*/
Q_PROPERTY(QStringList ids READ ids WRITE setIds NOTIFY idsChanged)
QList<QUuid> ids() const;
/**
* @brief Gets or sets item ids to add to the playlist.
*/
void setIds(QList<QUuid> newIds);
/**
* @brief Gets or sets the user id.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
QUuid userId() const;
/**
* @brief Gets or sets the user id.
*/
void setUserId(QUuid newUserId);
/**
* @brief Gets or sets the media type.
*/
Q_PROPERTY(QString mediaType READ mediaType WRITE setMediaType NOTIFY mediaTypeChanged)
QString name() const;
void setName(QString newName);
QStringList ids() const;
void setIds(QStringList newIds);
QString userId() const;
void setUserId(QString newUserId);
QString mediaType() const;
/**
* @brief Gets or sets the media type.
*/
void setMediaType(QString newMediaType);
signals:
void nameChanged(QString newName);
void idsChanged(QStringList newIds);
void userIdChanged(QString newUserId);
void mediaTypeChanged(QString newMediaType);
protected:
QString m_name;
QStringList m_ids;
QString m_userId;
QList<QUuid> m_ids;
QUuid m_userId;
QString m_mediaType;
};
} // NS DTO
namespace Support {
using CreatePlaylistDto = Jellyfin::DTO::CreatePlaylistDto;
template <>
CreatePlaylistDto fromJsonValue<CreatePlaylistDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CreatePlaylistDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,43 +31,58 @@
#define JELLYFIN_DTO_CREATEUSERBYNAME_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CreateUserByName : public QObject {
Q_OBJECT
public:
explicit CreateUserByName(QObject *parent = nullptr);
static CreateUserByName *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class CreateUserByName {
public:
explicit CreateUserByName();
static CreateUserByName fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the username.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the username.
*/
void setName(QString newName);
/**
* @brief Gets or sets the password.
*/
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
QString name() const;
void setName(QString newName);
QString password() const;
/**
* @brief Gets or sets the password.
*/
void setPassword(QString newPassword);
signals:
void nameChanged(QString newName);
void passwordChanged(QString newPassword);
protected:
QString m_name;
QString m_password;
};
} // NS DTO
namespace Support {
using CreateUserByName = Jellyfin::DTO::CreateUserByName;
template <>
CreateUserByName fromJsonValue<CreateUserByName>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CreateUserByName::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,61 +31,63 @@
#define JELLYFIN_DTO_CULTUREDTO_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CultureDto : public QObject {
Q_OBJECT
public:
explicit CultureDto(QObject *parent = nullptr);
static CultureDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class CultureDto {
public:
explicit CultureDto();
static CultureDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the display name.
*/
Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
QString displayName() const;
/**
* @brief Gets or sets the display name.
*/
void setDisplayName(QString newDisplayName);
/**
* @brief Gets or sets the name of the two letter ISO language.
*/
Q_PROPERTY(QString twoLetterISOLanguageName READ twoLetterISOLanguageName WRITE setTwoLetterISOLanguageName NOTIFY twoLetterISOLanguageNameChanged)
QString twoLetterISOLanguageName() const;
/**
* @brief Gets or sets the name of the two letter ISO language.
*/
void setTwoLetterISOLanguageName(QString newTwoLetterISOLanguageName);
/**
* @brief Gets or sets the name of the three letter ISO language.
*/
Q_PROPERTY(QString threeLetterISOLanguageName READ threeLetterISOLanguageName WRITE setThreeLetterISOLanguageName NOTIFY threeLetterISOLanguageNameChanged)
Q_PROPERTY(QStringList threeLetterISOLanguageNames READ threeLetterISOLanguageNames WRITE setThreeLetterISOLanguageNames NOTIFY threeLetterISOLanguageNamesChanged)
QString name() const;
void setName(QString newName);
QString displayName() const;
void setDisplayName(QString newDisplayName);
QString twoLetterISOLanguageName() const;
void setTwoLetterISOLanguageName(QString newTwoLetterISOLanguageName);
QString threeLetterISOLanguageName() const;
/**
* @brief Gets or sets the name of the three letter ISO language.
*/
void setThreeLetterISOLanguageName(QString newThreeLetterISOLanguageName);
QStringList threeLetterISOLanguageNames() const;
void setThreeLetterISOLanguageNames(QStringList newThreeLetterISOLanguageNames);
signals:
void nameChanged(QString newName);
void displayNameChanged(QString newDisplayName);
void twoLetterISOLanguageNameChanged(QString newTwoLetterISOLanguageName);
void threeLetterISOLanguageNameChanged(QString newThreeLetterISOLanguageName);
void threeLetterISOLanguageNamesChanged(QStringList newThreeLetterISOLanguageNames);
protected:
QString m_name;
QString m_displayName;
@ -94,6 +96,18 @@ protected:
QStringList m_threeLetterISOLanguageNames;
};
} // NS DTO
namespace Support {
using CultureDto = Jellyfin::DTO::CultureDto;
template <>
CultureDto fromJsonValue<CultureDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return CultureDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_DAYOFWEEK_H
#define JELLYFIN_DTO_DAYOFWEEK_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class DayOfWeekClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Sunday,
Monday,
Tuesday,
@ -51,8 +56,46 @@ public:
private:
explicit DayOfWeekClass();
};
typedef DayOfWeekClass::Value DayOfWeek;
} // NS DTO
namespace Support {
using DayOfWeek = Jellyfin::DTO::DayOfWeek;
using DayOfWeekClass = Jellyfin::DTO::DayOfWeekClass;
template <>
DayOfWeek fromJsonValue<DayOfWeek>(const QJsonValue &source) {
if (!source.isString()) return DayOfWeekClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Sunday")) {
return DayOfWeekClass::Sunday;
}
if (str == QStringLiteral("Monday")) {
return DayOfWeekClass::Monday;
}
if (str == QStringLiteral("Tuesday")) {
return DayOfWeekClass::Tuesday;
}
if (str == QStringLiteral("Wednesday")) {
return DayOfWeekClass::Wednesday;
}
if (str == QStringLiteral("Thursday")) {
return DayOfWeekClass::Thursday;
}
if (str == QStringLiteral("Friday")) {
return DayOfWeekClass::Friday;
}
if (str == QStringLiteral("Saturday")) {
return DayOfWeekClass::Saturday;
}
return DayOfWeekClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_DAYPATTERN_H
#define JELLYFIN_DTO_DAYPATTERN_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class DayPatternClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Daily,
Weekdays,
Weekends,
@ -47,8 +52,34 @@ public:
private:
explicit DayPatternClass();
};
typedef DayPatternClass::Value DayPattern;
} // NS DTO
namespace Support {
using DayPattern = Jellyfin::DTO::DayPattern;
using DayPatternClass = Jellyfin::DTO::DayPatternClass;
template <>
DayPattern fromJsonValue<DayPattern>(const QJsonValue &source) {
if (!source.isString()) return DayPatternClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Daily")) {
return DayPatternClass::Daily;
}
if (str == QStringLiteral("Weekdays")) {
return DayPatternClass::Weekdays;
}
if (str == QStringLiteral("Weekends")) {
return DayPatternClass::Weekends;
}
return DayPatternClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,34 +31,49 @@
#define JELLYFIN_DTO_DEFAULTDIRECTORYBROWSERINFODTO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DefaultDirectoryBrowserInfoDto : public QObject {
Q_OBJECT
public:
explicit DefaultDirectoryBrowserInfoDto(QObject *parent = nullptr);
static DefaultDirectoryBrowserInfoDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class DefaultDirectoryBrowserInfoDto {
public:
explicit DefaultDirectoryBrowserInfoDto();
static DefaultDirectoryBrowserInfoDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
signals:
void pathChanged(QString newPath);
protected:
QString m_path;
};
} // NS DTO
namespace Support {
using DefaultDirectoryBrowserInfoDto = Jellyfin::DTO::DefaultDirectoryBrowserInfoDto;
template <>
DefaultDirectoryBrowserInfoDto fromJsonValue<DefaultDirectoryBrowserInfoDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DefaultDirectoryBrowserInfoDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,98 +31,101 @@
#define JELLYFIN_DTO_DEVICEIDENTIFICATION_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/httpheaderinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class HttpHeaderInfo;
class DeviceIdentification : public QObject {
Q_OBJECT
class DeviceIdentification {
public:
explicit DeviceIdentification(QObject *parent = nullptr);
static DeviceIdentification *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit DeviceIdentification();
static DeviceIdentification fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name of the friendly.
*/
Q_PROPERTY(QString friendlyName READ friendlyName WRITE setFriendlyName NOTIFY friendlyNameChanged)
QString friendlyName() const;
/**
* @brief Gets or sets the name of the friendly.
*/
void setFriendlyName(QString newFriendlyName);
/**
* @brief Gets or sets the model number.
*/
Q_PROPERTY(QString modelNumber READ modelNumber WRITE setModelNumber NOTIFY modelNumberChanged)
QString modelNumber() const;
/**
* @brief Gets or sets the model number.
*/
void setModelNumber(QString newModelNumber);
/**
* @brief Gets or sets the serial number.
*/
Q_PROPERTY(QString serialNumber READ serialNumber WRITE setSerialNumber NOTIFY serialNumberChanged)
QString serialNumber() const;
/**
* @brief Gets or sets the serial number.
*/
void setSerialNumber(QString newSerialNumber);
/**
* @brief Gets or sets the name of the model.
*/
Q_PROPERTY(QString modelName READ modelName WRITE setModelName NOTIFY modelNameChanged)
QString modelName() const;
/**
* @brief Gets or sets the name of the model.
*/
void setModelName(QString newModelName);
/**
* @brief Gets or sets the model description.
*/
Q_PROPERTY(QString modelDescription READ modelDescription WRITE setModelDescription NOTIFY modelDescriptionChanged)
QString modelDescription() const;
/**
* @brief Gets or sets the model description.
*/
void setModelDescription(QString newModelDescription);
/**
* @brief Gets or sets the model URL.
*/
Q_PROPERTY(QString modelUrl READ modelUrl WRITE setModelUrl NOTIFY modelUrlChanged)
QString modelUrl() const;
/**
* @brief Gets or sets the model URL.
*/
void setModelUrl(QString newModelUrl);
/**
* @brief Gets or sets the manufacturer.
*/
Q_PROPERTY(QString manufacturer READ manufacturer WRITE setManufacturer NOTIFY manufacturerChanged)
QString manufacturer() const;
/**
* @brief Gets or sets the manufacturer.
*/
void setManufacturer(QString newManufacturer);
/**
* @brief Gets or sets the manufacturer URL.
*/
Q_PROPERTY(QString manufacturerUrl READ manufacturerUrl WRITE setManufacturerUrl NOTIFY manufacturerUrlChanged)
QString manufacturerUrl() const;
/**
* @brief Gets or sets the manufacturer URL.
*/
void setManufacturerUrl(QString newManufacturerUrl);
/**
* @brief Gets or sets the headers.
*/
Q_PROPERTY(QList<HttpHeaderInfo *> headers READ headers WRITE setHeaders NOTIFY headersChanged)
QList<QSharedPointer<HttpHeaderInfo>> headers() const;
/**
* @brief Gets or sets the headers.
*/
void setHeaders(QList<QSharedPointer<HttpHeaderInfo>> newHeaders);
QString friendlyName() const;
void setFriendlyName(QString newFriendlyName);
QString modelNumber() const;
void setModelNumber(QString newModelNumber);
QString serialNumber() const;
void setSerialNumber(QString newSerialNumber);
QString modelName() const;
void setModelName(QString newModelName);
QString modelDescription() const;
void setModelDescription(QString newModelDescription);
QString modelUrl() const;
void setModelUrl(QString newModelUrl);
QString manufacturer() const;
void setManufacturer(QString newManufacturer);
QString manufacturerUrl() const;
void setManufacturerUrl(QString newManufacturerUrl);
QList<HttpHeaderInfo *> headers() const;
void setHeaders(QList<HttpHeaderInfo *> newHeaders);
signals:
void friendlyNameChanged(QString newFriendlyName);
void modelNumberChanged(QString newModelNumber);
void serialNumberChanged(QString newSerialNumber);
void modelNameChanged(QString newModelName);
void modelDescriptionChanged(QString newModelDescription);
void modelUrlChanged(QString newModelUrl);
void manufacturerChanged(QString newManufacturer);
void manufacturerUrlChanged(QString newManufacturerUrl);
void headersChanged(QList<HttpHeaderInfo *> newHeaders);
protected:
QString m_friendlyName;
QString m_modelNumber;
@ -132,9 +135,21 @@ protected:
QString m_modelUrl;
QString m_manufacturer;
QString m_manufacturerUrl;
QList<HttpHeaderInfo *> m_headers;
QList<QSharedPointer<HttpHeaderInfo>> m_headers;
};
} // NS DTO
namespace Support {
using DeviceIdentification = Jellyfin::DTO::DeviceIdentification;
template <>
DeviceIdentification fromJsonValue<DeviceIdentification>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceIdentification::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,99 +32,112 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/clientcapabilities.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ClientCapabilities;
class DeviceInfo : public QObject {
Q_OBJECT
class DeviceInfo {
public:
explicit DeviceInfo(QObject *parent = nullptr);
static DeviceInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit DeviceInfo();
static DeviceInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
// Properties
QString name() const;
void setName(QString newName);
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(QString newJellyfinId);
/**
* @brief Gets or sets the last name of the user.
*/
Q_PROPERTY(QString lastUserName READ lastUserName WRITE setLastUserName NOTIFY lastUserNameChanged)
QString lastUserName() const;
/**
* @brief Gets or sets the last name of the user.
*/
void setLastUserName(QString newLastUserName);
/**
* @brief Gets or sets the name of the application.
*/
Q_PROPERTY(QString appName READ appName WRITE setAppName NOTIFY appNameChanged)
QString appName() const;
/**
* @brief Gets or sets the name of the application.
*/
void setAppName(QString newAppName);
/**
* @brief Gets or sets the application version.
*/
Q_PROPERTY(QString appVersion READ appVersion WRITE setAppVersion NOTIFY appVersionChanged)
QString appVersion() const;
/**
* @brief Gets or sets the application version.
*/
void setAppVersion(QString newAppVersion);
/**
* @brief Gets or sets the last user identifier.
*/
Q_PROPERTY(QString lastUserId READ lastUserId WRITE setLastUserId NOTIFY lastUserIdChanged)
QUuid lastUserId() const;
/**
* @brief Gets or sets the last user identifier.
*/
void setLastUserId(QUuid newLastUserId);
/**
* @brief Gets or sets the date last modified.
*/
Q_PROPERTY(QDateTime dateLastActivity READ dateLastActivity WRITE setDateLastActivity NOTIFY dateLastActivityChanged)
Q_PROPERTY(ClientCapabilities * capabilities READ capabilities WRITE setCapabilities NOTIFY capabilitiesChanged)
Q_PROPERTY(QString iconUrl READ iconUrl WRITE setIconUrl NOTIFY iconUrlChanged)
QString name() const;
void setName(QString newName);
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
QString lastUserName() const;
void setLastUserName(QString newLastUserName);
QString appName() const;
void setAppName(QString newAppName);
QString appVersion() const;
void setAppVersion(QString newAppVersion);
QString lastUserId() const;
void setLastUserId(QString newLastUserId);
QDateTime dateLastActivity() const;
/**
* @brief Gets or sets the date last modified.
*/
void setDateLastActivity(QDateTime newDateLastActivity);
ClientCapabilities * capabilities() const;
void setCapabilities(ClientCapabilities * newCapabilities);
QSharedPointer<ClientCapabilities> capabilities() const;
void setCapabilities(QSharedPointer<ClientCapabilities> newCapabilities);
QString iconUrl() const;
void setIconUrl(QString newIconUrl);
signals:
void nameChanged(QString newName);
void jellyfinIdChanged(QString newJellyfinId);
void lastUserNameChanged(QString newLastUserName);
void appNameChanged(QString newAppName);
void appVersionChanged(QString newAppVersion);
void lastUserIdChanged(QString newLastUserId);
void dateLastActivityChanged(QDateTime newDateLastActivity);
void capabilitiesChanged(ClientCapabilities * newCapabilities);
void iconUrlChanged(QString newIconUrl);
protected:
QString m_name;
QString m_jellyfinId;
QString m_lastUserName;
QString m_appName;
QString m_appVersion;
QString m_lastUserId;
QUuid m_lastUserId;
QDateTime m_dateLastActivity;
ClientCapabilities * m_capabilities = nullptr;
QSharedPointer<ClientCapabilities> m_capabilities = nullptr;
QString m_iconUrl;
};
} // NS DTO
namespace Support {
using DeviceInfo = Jellyfin::DTO::DeviceInfo;
template <>
DeviceInfo fromJsonValue<DeviceInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,55 +31,70 @@
#define JELLYFIN_DTO_DEVICEINFOQUERYRESULT_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/deviceinfo.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DeviceInfo;
class DeviceInfoQueryResult : public QObject {
Q_OBJECT
class DeviceInfoQueryResult {
public:
explicit DeviceInfoQueryResult(QObject *parent = nullptr);
static DeviceInfoQueryResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit DeviceInfoQueryResult();
static DeviceInfoQueryResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the items.
*/
Q_PROPERTY(QList<DeviceInfo *> items READ items WRITE setItems NOTIFY itemsChanged)
QList<QSharedPointer<DeviceInfo>> items() const;
/**
* @brief Gets or sets the items.
*/
void setItems(QList<QSharedPointer<DeviceInfo>> newItems);
/**
* @brief The total number of records available.
*/
Q_PROPERTY(qint32 totalRecordCount READ totalRecordCount WRITE setTotalRecordCount NOTIFY totalRecordCountChanged)
qint32 totalRecordCount() const;
/**
* @brief The total number of records available.
*/
void setTotalRecordCount(qint32 newTotalRecordCount);
/**
* @brief The index of the first record in Items.
*/
Q_PROPERTY(qint32 startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)
QList<DeviceInfo *> items() const;
void setItems(QList<DeviceInfo *> newItems);
qint32 totalRecordCount() const;
void setTotalRecordCount(qint32 newTotalRecordCount);
qint32 startIndex() const;
/**
* @brief The index of the first record in Items.
*/
void setStartIndex(qint32 newStartIndex);
signals:
void itemsChanged(QList<DeviceInfo *> newItems);
void totalRecordCountChanged(qint32 newTotalRecordCount);
void startIndexChanged(qint32 newStartIndex);
protected:
QList<DeviceInfo *> m_items;
QList<QSharedPointer<DeviceInfo>> m_items;
qint32 m_totalRecordCount;
qint32 m_startIndex;
};
} // NS DTO
namespace Support {
using DeviceInfoQueryResult = Jellyfin::DTO::DeviceInfoQueryResult;
template <>
DeviceInfoQueryResult fromJsonValue<DeviceInfoQueryResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceInfoQueryResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,31 +31,45 @@
#define JELLYFIN_DTO_DEVICEOPTIONS_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DeviceOptions : public QObject {
Q_OBJECT
public:
explicit DeviceOptions(QObject *parent = nullptr);
static DeviceOptions *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(QString customName READ customName WRITE setCustomName NOTIFY customNameChanged)
class DeviceOptions {
public:
explicit DeviceOptions();
static DeviceOptions fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
QString customName() const;
void setCustomName(QString newCustomName);
signals:
void customNameChanged(QString newCustomName);
protected:
QString m_customName;
};
} // NS DTO
namespace Support {
using DeviceOptions = Jellyfin::DTO::DeviceOptions;
template <>
DeviceOptions fromJsonValue<DeviceOptions>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceOptions::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,346 +31,348 @@
#define JELLYFIN_DTO_DEVICEPROFILE_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/codecprofile.h"
#include "JellyfinQt/DTO/containerprofile.h"
#include "JellyfinQt/DTO/deviceidentification.h"
#include "JellyfinQt/DTO/directplayprofile.h"
#include "JellyfinQt/DTO/responseprofile.h"
#include "JellyfinQt/DTO/subtitleprofile.h"
#include "JellyfinQt/DTO/transcodingprofile.h"
#include "JellyfinQt/DTO/xmlattribute.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class CodecProfile;
class ContainerProfile;
class DeviceIdentification;
class DirectPlayProfile;
class ResponseProfile;
class SubtitleProfile;
class TranscodingProfile;
class XmlAttribute;
class DeviceProfile : public QObject {
Q_OBJECT
class DeviceProfile {
public:
explicit DeviceProfile(QObject *parent = nullptr);
static DeviceProfile *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit DeviceProfile();
static DeviceProfile fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the Name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the Name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the Id.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
Q_PROPERTY(DeviceIdentification * identification READ identification WRITE setIdentification NOTIFY identificationChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the Id.
*/
void setJellyfinId(QString newJellyfinId);
QSharedPointer<DeviceIdentification> identification() const;
void setIdentification(QSharedPointer<DeviceIdentification> newIdentification);
/**
* @brief Gets or sets the FriendlyName.
*/
Q_PROPERTY(QString friendlyName READ friendlyName WRITE setFriendlyName NOTIFY friendlyNameChanged)
QString friendlyName() const;
/**
* @brief Gets or sets the FriendlyName.
*/
void setFriendlyName(QString newFriendlyName);
/**
* @brief Gets or sets the Manufacturer.
*/
Q_PROPERTY(QString manufacturer READ manufacturer WRITE setManufacturer NOTIFY manufacturerChanged)
QString manufacturer() const;
/**
* @brief Gets or sets the Manufacturer.
*/
void setManufacturer(QString newManufacturer);
/**
* @brief Gets or sets the ManufacturerUrl.
*/
Q_PROPERTY(QString manufacturerUrl READ manufacturerUrl WRITE setManufacturerUrl NOTIFY manufacturerUrlChanged)
QString manufacturerUrl() const;
/**
* @brief Gets or sets the ManufacturerUrl.
*/
void setManufacturerUrl(QString newManufacturerUrl);
/**
* @brief Gets or sets the ModelName.
*/
Q_PROPERTY(QString modelName READ modelName WRITE setModelName NOTIFY modelNameChanged)
QString modelName() const;
/**
* @brief Gets or sets the ModelName.
*/
void setModelName(QString newModelName);
/**
* @brief Gets or sets the ModelDescription.
*/
Q_PROPERTY(QString modelDescription READ modelDescription WRITE setModelDescription NOTIFY modelDescriptionChanged)
QString modelDescription() const;
/**
* @brief Gets or sets the ModelDescription.
*/
void setModelDescription(QString newModelDescription);
/**
* @brief Gets or sets the ModelNumber.
*/
Q_PROPERTY(QString modelNumber READ modelNumber WRITE setModelNumber NOTIFY modelNumberChanged)
QString modelNumber() const;
/**
* @brief Gets or sets the ModelNumber.
*/
void setModelNumber(QString newModelNumber);
/**
* @brief Gets or sets the ModelUrl.
*/
Q_PROPERTY(QString modelUrl READ modelUrl WRITE setModelUrl NOTIFY modelUrlChanged)
QString modelUrl() const;
/**
* @brief Gets or sets the ModelUrl.
*/
void setModelUrl(QString newModelUrl);
/**
* @brief Gets or sets the SerialNumber.
*/
Q_PROPERTY(QString serialNumber READ serialNumber WRITE setSerialNumber NOTIFY serialNumberChanged)
QString serialNumber() const;
/**
* @brief Gets or sets the SerialNumber.
*/
void setSerialNumber(QString newSerialNumber);
/**
* @brief Gets or sets a value indicating whether EnableAlbumArtInDidl.
*/
Q_PROPERTY(bool enableAlbumArtInDidl READ enableAlbumArtInDidl WRITE setEnableAlbumArtInDidl NOTIFY enableAlbumArtInDidlChanged)
bool enableAlbumArtInDidl() const;
/**
* @brief Gets or sets a value indicating whether EnableAlbumArtInDidl.
*/
void setEnableAlbumArtInDidl(bool newEnableAlbumArtInDidl);
/**
* @brief Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
*/
Q_PROPERTY(bool enableSingleAlbumArtLimit READ enableSingleAlbumArtLimit WRITE setEnableSingleAlbumArtLimit NOTIFY enableSingleAlbumArtLimitChanged)
bool enableSingleAlbumArtLimit() const;
/**
* @brief Gets or sets a value indicating whether EnableSingleAlbumArtLimit.
*/
void setEnableSingleAlbumArtLimit(bool newEnableSingleAlbumArtLimit);
/**
* @brief Gets or sets a value indicating whether EnableSingleSubtitleLimit.
*/
Q_PROPERTY(bool enableSingleSubtitleLimit READ enableSingleSubtitleLimit WRITE setEnableSingleSubtitleLimit NOTIFY enableSingleSubtitleLimitChanged)
bool enableSingleSubtitleLimit() const;
/**
* @brief Gets or sets a value indicating whether EnableSingleSubtitleLimit.
*/
void setEnableSingleSubtitleLimit(bool newEnableSingleSubtitleLimit);
/**
* @brief Gets or sets the SupportedMediaTypes.
*/
Q_PROPERTY(QString supportedMediaTypes READ supportedMediaTypes WRITE setSupportedMediaTypes NOTIFY supportedMediaTypesChanged)
QString supportedMediaTypes() const;
/**
* @brief Gets or sets the SupportedMediaTypes.
*/
void setSupportedMediaTypes(QString newSupportedMediaTypes);
/**
* @brief Gets or sets the UserId.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
QString userId() const;
/**
* @brief Gets or sets the UserId.
*/
void setUserId(QString newUserId);
/**
* @brief Gets or sets the AlbumArtPn.
*/
Q_PROPERTY(QString albumArtPn READ albumArtPn WRITE setAlbumArtPn NOTIFY albumArtPnChanged)
QString albumArtPn() const;
/**
* @brief Gets or sets the AlbumArtPn.
*/
void setAlbumArtPn(QString newAlbumArtPn);
/**
* @brief Gets or sets the MaxAlbumArtWidth.
*/
Q_PROPERTY(qint32 maxAlbumArtWidth READ maxAlbumArtWidth WRITE setMaxAlbumArtWidth NOTIFY maxAlbumArtWidthChanged)
qint32 maxAlbumArtWidth() const;
/**
* @brief Gets or sets the MaxAlbumArtWidth.
*/
void setMaxAlbumArtWidth(qint32 newMaxAlbumArtWidth);
/**
* @brief Gets or sets the MaxAlbumArtHeight.
*/
Q_PROPERTY(qint32 maxAlbumArtHeight READ maxAlbumArtHeight WRITE setMaxAlbumArtHeight NOTIFY maxAlbumArtHeightChanged)
qint32 maxAlbumArtHeight() const;
/**
* @brief Gets or sets the MaxAlbumArtHeight.
*/
void setMaxAlbumArtHeight(qint32 newMaxAlbumArtHeight);
/**
* @brief Gets or sets the MaxIconWidth.
*/
Q_PROPERTY(qint32 maxIconWidth READ maxIconWidth WRITE setMaxIconWidth NOTIFY maxIconWidthChanged)
qint32 maxIconWidth() const;
/**
* @brief Gets or sets the MaxIconWidth.
*/
void setMaxIconWidth(qint32 newMaxIconWidth);
/**
* @brief Gets or sets the MaxIconHeight.
*/
Q_PROPERTY(qint32 maxIconHeight READ maxIconHeight WRITE setMaxIconHeight NOTIFY maxIconHeightChanged)
qint32 maxIconHeight() const;
/**
* @brief Gets or sets the MaxIconHeight.
*/
void setMaxIconHeight(qint32 newMaxIconHeight);
/**
* @brief Gets or sets the MaxStreamingBitrate.
*/
Q_PROPERTY(qint32 maxStreamingBitrate READ maxStreamingBitrate WRITE setMaxStreamingBitrate NOTIFY maxStreamingBitrateChanged)
qint32 maxStreamingBitrate() const;
/**
* @brief Gets or sets the MaxStreamingBitrate.
*/
void setMaxStreamingBitrate(qint32 newMaxStreamingBitrate);
/**
* @brief Gets or sets the MaxStaticBitrate.
*/
Q_PROPERTY(qint32 maxStaticBitrate READ maxStaticBitrate WRITE setMaxStaticBitrate NOTIFY maxStaticBitrateChanged)
qint32 maxStaticBitrate() const;
/**
* @brief Gets or sets the MaxStaticBitrate.
*/
void setMaxStaticBitrate(qint32 newMaxStaticBitrate);
/**
* @brief Gets or sets the MusicStreamingTranscodingBitrate.
*/
Q_PROPERTY(qint32 musicStreamingTranscodingBitrate READ musicStreamingTranscodingBitrate WRITE setMusicStreamingTranscodingBitrate NOTIFY musicStreamingTranscodingBitrateChanged)
qint32 musicStreamingTranscodingBitrate() const;
/**
* @brief Gets or sets the MusicStreamingTranscodingBitrate.
*/
void setMusicStreamingTranscodingBitrate(qint32 newMusicStreamingTranscodingBitrate);
/**
* @brief Gets or sets the MaxStaticMusicBitrate.
*/
Q_PROPERTY(qint32 maxStaticMusicBitrate READ maxStaticMusicBitrate WRITE setMaxStaticMusicBitrate NOTIFY maxStaticMusicBitrateChanged)
qint32 maxStaticMusicBitrate() const;
/**
* @brief Gets or sets the MaxStaticMusicBitrate.
*/
void setMaxStaticMusicBitrate(qint32 newMaxStaticMusicBitrate);
/**
* @brief Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
*/
Q_PROPERTY(QString sonyAggregationFlags READ sonyAggregationFlags WRITE setSonyAggregationFlags NOTIFY sonyAggregationFlagsChanged)
QString sonyAggregationFlags() const;
/**
* @brief Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
*/
void setSonyAggregationFlags(QString newSonyAggregationFlags);
/**
* @brief Gets or sets the ProtocolInfo.
*/
Q_PROPERTY(QString protocolInfo READ protocolInfo WRITE setProtocolInfo NOTIFY protocolInfoChanged)
QString protocolInfo() const;
/**
* @brief Gets or sets the ProtocolInfo.
*/
void setProtocolInfo(QString newProtocolInfo);
/**
* @brief Gets or sets the TimelineOffsetSeconds.
*/
Q_PROPERTY(qint32 timelineOffsetSeconds READ timelineOffsetSeconds WRITE setTimelineOffsetSeconds NOTIFY timelineOffsetSecondsChanged)
qint32 timelineOffsetSeconds() const;
/**
* @brief Gets or sets the TimelineOffsetSeconds.
*/
void setTimelineOffsetSeconds(qint32 newTimelineOffsetSeconds);
/**
* @brief Gets or sets a value indicating whether RequiresPlainVideoItems.
*/
Q_PROPERTY(bool requiresPlainVideoItems READ requiresPlainVideoItems WRITE setRequiresPlainVideoItems NOTIFY requiresPlainVideoItemsChanged)
bool requiresPlainVideoItems() const;
/**
* @brief Gets or sets a value indicating whether RequiresPlainVideoItems.
*/
void setRequiresPlainVideoItems(bool newRequiresPlainVideoItems);
/**
* @brief Gets or sets a value indicating whether RequiresPlainFolders.
*/
Q_PROPERTY(bool requiresPlainFolders READ requiresPlainFolders WRITE setRequiresPlainFolders NOTIFY requiresPlainFoldersChanged)
bool requiresPlainFolders() const;
/**
* @brief Gets or sets a value indicating whether RequiresPlainFolders.
*/
void setRequiresPlainFolders(bool newRequiresPlainFolders);
/**
* @brief Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
*/
Q_PROPERTY(bool enableMSMediaReceiverRegistrar READ enableMSMediaReceiverRegistrar WRITE setEnableMSMediaReceiverRegistrar NOTIFY enableMSMediaReceiverRegistrarChanged)
bool enableMSMediaReceiverRegistrar() const;
/**
* @brief Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar.
*/
void setEnableMSMediaReceiverRegistrar(bool newEnableMSMediaReceiverRegistrar);
/**
* @brief Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
*/
Q_PROPERTY(bool ignoreTranscodeByteRangeRequests READ ignoreTranscodeByteRangeRequests WRITE setIgnoreTranscodeByteRangeRequests NOTIFY ignoreTranscodeByteRangeRequestsChanged)
bool ignoreTranscodeByteRangeRequests() const;
/**
* @brief Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests.
*/
void setIgnoreTranscodeByteRangeRequests(bool newIgnoreTranscodeByteRangeRequests);
/**
* @brief Gets or sets the XmlRootAttributes.
*/
Q_PROPERTY(QList<XmlAttribute *> xmlRootAttributes READ xmlRootAttributes WRITE setXmlRootAttributes NOTIFY xmlRootAttributesChanged)
QList<QSharedPointer<XmlAttribute>> xmlRootAttributes() const;
/**
* @brief Gets or sets the XmlRootAttributes.
*/
void setXmlRootAttributes(QList<QSharedPointer<XmlAttribute>> newXmlRootAttributes);
/**
* @brief Gets or sets the direct play profiles.
*/
Q_PROPERTY(QList<DirectPlayProfile *> directPlayProfiles READ directPlayProfiles WRITE setDirectPlayProfiles NOTIFY directPlayProfilesChanged)
QList<QSharedPointer<DirectPlayProfile>> directPlayProfiles() const;
/**
* @brief Gets or sets the direct play profiles.
*/
void setDirectPlayProfiles(QList<QSharedPointer<DirectPlayProfile>> newDirectPlayProfiles);
/**
* @brief Gets or sets the transcoding profiles.
*/
Q_PROPERTY(QList<TranscodingProfile *> transcodingProfiles READ transcodingProfiles WRITE setTranscodingProfiles NOTIFY transcodingProfilesChanged)
QList<QSharedPointer<TranscodingProfile>> transcodingProfiles() const;
/**
* @brief Gets or sets the transcoding profiles.
*/
void setTranscodingProfiles(QList<QSharedPointer<TranscodingProfile>> newTranscodingProfiles);
/**
* @brief Gets or sets the ContainerProfiles.
*/
Q_PROPERTY(QList<ContainerProfile *> containerProfiles READ containerProfiles WRITE setContainerProfiles NOTIFY containerProfilesChanged)
QList<QSharedPointer<ContainerProfile>> containerProfiles() const;
/**
* @brief Gets or sets the ContainerProfiles.
*/
void setContainerProfiles(QList<QSharedPointer<ContainerProfile>> newContainerProfiles);
/**
* @brief Gets or sets the CodecProfiles.
*/
Q_PROPERTY(QList<CodecProfile *> codecProfiles READ codecProfiles WRITE setCodecProfiles NOTIFY codecProfilesChanged)
QList<QSharedPointer<CodecProfile>> codecProfiles() const;
/**
* @brief Gets or sets the CodecProfiles.
*/
void setCodecProfiles(QList<QSharedPointer<CodecProfile>> newCodecProfiles);
/**
* @brief Gets or sets the ResponseProfiles.
*/
Q_PROPERTY(QList<ResponseProfile *> responseProfiles READ responseProfiles WRITE setResponseProfiles NOTIFY responseProfilesChanged)
QList<QSharedPointer<ResponseProfile>> responseProfiles() const;
/**
* @brief Gets or sets the ResponseProfiles.
*/
void setResponseProfiles(QList<QSharedPointer<ResponseProfile>> newResponseProfiles);
/**
* @brief Gets or sets the SubtitleProfiles.
*/
Q_PROPERTY(QList<SubtitleProfile *> subtitleProfiles READ subtitleProfiles WRITE setSubtitleProfiles NOTIFY subtitleProfilesChanged)
QList<QSharedPointer<SubtitleProfile>> subtitleProfiles() const;
/**
* @brief Gets or sets the SubtitleProfiles.
*/
void setSubtitleProfiles(QList<QSharedPointer<SubtitleProfile>> newSubtitleProfiles);
QString name() const;
void setName(QString newName);
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
DeviceIdentification * identification() const;
void setIdentification(DeviceIdentification * newIdentification);
QString friendlyName() const;
void setFriendlyName(QString newFriendlyName);
QString manufacturer() const;
void setManufacturer(QString newManufacturer);
QString manufacturerUrl() const;
void setManufacturerUrl(QString newManufacturerUrl);
QString modelName() const;
void setModelName(QString newModelName);
QString modelDescription() const;
void setModelDescription(QString newModelDescription);
QString modelNumber() const;
void setModelNumber(QString newModelNumber);
QString modelUrl() const;
void setModelUrl(QString newModelUrl);
QString serialNumber() const;
void setSerialNumber(QString newSerialNumber);
bool enableAlbumArtInDidl() const;
void setEnableAlbumArtInDidl(bool newEnableAlbumArtInDidl);
bool enableSingleAlbumArtLimit() const;
void setEnableSingleAlbumArtLimit(bool newEnableSingleAlbumArtLimit);
bool enableSingleSubtitleLimit() const;
void setEnableSingleSubtitleLimit(bool newEnableSingleSubtitleLimit);
QString supportedMediaTypes() const;
void setSupportedMediaTypes(QString newSupportedMediaTypes);
QString userId() const;
void setUserId(QString newUserId);
QString albumArtPn() const;
void setAlbumArtPn(QString newAlbumArtPn);
qint32 maxAlbumArtWidth() const;
void setMaxAlbumArtWidth(qint32 newMaxAlbumArtWidth);
qint32 maxAlbumArtHeight() const;
void setMaxAlbumArtHeight(qint32 newMaxAlbumArtHeight);
qint32 maxIconWidth() const;
void setMaxIconWidth(qint32 newMaxIconWidth);
qint32 maxIconHeight() const;
void setMaxIconHeight(qint32 newMaxIconHeight);
qint32 maxStreamingBitrate() const;
void setMaxStreamingBitrate(qint32 newMaxStreamingBitrate);
qint32 maxStaticBitrate() const;
void setMaxStaticBitrate(qint32 newMaxStaticBitrate);
qint32 musicStreamingTranscodingBitrate() const;
void setMusicStreamingTranscodingBitrate(qint32 newMusicStreamingTranscodingBitrate);
qint32 maxStaticMusicBitrate() const;
void setMaxStaticMusicBitrate(qint32 newMaxStaticMusicBitrate);
QString sonyAggregationFlags() const;
void setSonyAggregationFlags(QString newSonyAggregationFlags);
QString protocolInfo() const;
void setProtocolInfo(QString newProtocolInfo);
qint32 timelineOffsetSeconds() const;
void setTimelineOffsetSeconds(qint32 newTimelineOffsetSeconds);
bool requiresPlainVideoItems() const;
void setRequiresPlainVideoItems(bool newRequiresPlainVideoItems);
bool requiresPlainFolders() const;
void setRequiresPlainFolders(bool newRequiresPlainFolders);
bool enableMSMediaReceiverRegistrar() const;
void setEnableMSMediaReceiverRegistrar(bool newEnableMSMediaReceiverRegistrar);
bool ignoreTranscodeByteRangeRequests() const;
void setIgnoreTranscodeByteRangeRequests(bool newIgnoreTranscodeByteRangeRequests);
QList<XmlAttribute *> xmlRootAttributes() const;
void setXmlRootAttributes(QList<XmlAttribute *> newXmlRootAttributes);
QList<DirectPlayProfile *> directPlayProfiles() const;
void setDirectPlayProfiles(QList<DirectPlayProfile *> newDirectPlayProfiles);
QList<TranscodingProfile *> transcodingProfiles() const;
void setTranscodingProfiles(QList<TranscodingProfile *> newTranscodingProfiles);
QList<ContainerProfile *> containerProfiles() const;
void setContainerProfiles(QList<ContainerProfile *> newContainerProfiles);
QList<CodecProfile *> codecProfiles() const;
void setCodecProfiles(QList<CodecProfile *> newCodecProfiles);
QList<ResponseProfile *> responseProfiles() const;
void setResponseProfiles(QList<ResponseProfile *> newResponseProfiles);
QList<SubtitleProfile *> subtitleProfiles() const;
void setSubtitleProfiles(QList<SubtitleProfile *> newSubtitleProfiles);
signals:
void nameChanged(QString newName);
void jellyfinIdChanged(QString newJellyfinId);
void identificationChanged(DeviceIdentification * newIdentification);
void friendlyNameChanged(QString newFriendlyName);
void manufacturerChanged(QString newManufacturer);
void manufacturerUrlChanged(QString newManufacturerUrl);
void modelNameChanged(QString newModelName);
void modelDescriptionChanged(QString newModelDescription);
void modelNumberChanged(QString newModelNumber);
void modelUrlChanged(QString newModelUrl);
void serialNumberChanged(QString newSerialNumber);
void enableAlbumArtInDidlChanged(bool newEnableAlbumArtInDidl);
void enableSingleAlbumArtLimitChanged(bool newEnableSingleAlbumArtLimit);
void enableSingleSubtitleLimitChanged(bool newEnableSingleSubtitleLimit);
void supportedMediaTypesChanged(QString newSupportedMediaTypes);
void userIdChanged(QString newUserId);
void albumArtPnChanged(QString newAlbumArtPn);
void maxAlbumArtWidthChanged(qint32 newMaxAlbumArtWidth);
void maxAlbumArtHeightChanged(qint32 newMaxAlbumArtHeight);
void maxIconWidthChanged(qint32 newMaxIconWidth);
void maxIconHeightChanged(qint32 newMaxIconHeight);
void maxStreamingBitrateChanged(qint32 newMaxStreamingBitrate);
void maxStaticBitrateChanged(qint32 newMaxStaticBitrate);
void musicStreamingTranscodingBitrateChanged(qint32 newMusicStreamingTranscodingBitrate);
void maxStaticMusicBitrateChanged(qint32 newMaxStaticMusicBitrate);
void sonyAggregationFlagsChanged(QString newSonyAggregationFlags);
void protocolInfoChanged(QString newProtocolInfo);
void timelineOffsetSecondsChanged(qint32 newTimelineOffsetSeconds);
void requiresPlainVideoItemsChanged(bool newRequiresPlainVideoItems);
void requiresPlainFoldersChanged(bool newRequiresPlainFolders);
void enableMSMediaReceiverRegistrarChanged(bool newEnableMSMediaReceiverRegistrar);
void ignoreTranscodeByteRangeRequestsChanged(bool newIgnoreTranscodeByteRangeRequests);
void xmlRootAttributesChanged(QList<XmlAttribute *> newXmlRootAttributes);
void directPlayProfilesChanged(QList<DirectPlayProfile *> newDirectPlayProfiles);
void transcodingProfilesChanged(QList<TranscodingProfile *> newTranscodingProfiles);
void containerProfilesChanged(QList<ContainerProfile *> newContainerProfiles);
void codecProfilesChanged(QList<CodecProfile *> newCodecProfiles);
void responseProfilesChanged(QList<ResponseProfile *> newResponseProfiles);
void subtitleProfilesChanged(QList<SubtitleProfile *> newSubtitleProfiles);
protected:
QString m_name;
QString m_jellyfinId;
DeviceIdentification * m_identification = nullptr;
QSharedPointer<DeviceIdentification> m_identification = nullptr;
QString m_friendlyName;
QString m_manufacturer;
QString m_manufacturerUrl;
@ -400,15 +402,27 @@ protected:
bool m_requiresPlainFolders;
bool m_enableMSMediaReceiverRegistrar;
bool m_ignoreTranscodeByteRangeRequests;
QList<XmlAttribute *> m_xmlRootAttributes;
QList<DirectPlayProfile *> m_directPlayProfiles;
QList<TranscodingProfile *> m_transcodingProfiles;
QList<ContainerProfile *> m_containerProfiles;
QList<CodecProfile *> m_codecProfiles;
QList<ResponseProfile *> m_responseProfiles;
QList<SubtitleProfile *> m_subtitleProfiles;
QList<QSharedPointer<XmlAttribute>> m_xmlRootAttributes;
QList<QSharedPointer<DirectPlayProfile>> m_directPlayProfiles;
QList<QSharedPointer<TranscodingProfile>> m_transcodingProfiles;
QList<QSharedPointer<ContainerProfile>> m_containerProfiles;
QList<QSharedPointer<CodecProfile>> m_codecProfiles;
QList<QSharedPointer<ResponseProfile>> m_responseProfiles;
QList<QSharedPointer<SubtitleProfile>> m_subtitleProfiles;
};
} // NS DTO
namespace Support {
using DeviceProfile = Jellyfin::DTO::DeviceProfile;
template <>
DeviceProfile fromJsonValue<DeviceProfile>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceProfile::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,51 +31,64 @@
#define JELLYFIN_DTO_DEVICEPROFILEINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/deviceprofiletype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DeviceProfileInfo : public QObject {
Q_OBJECT
public:
explicit DeviceProfileInfo(QObject *parent = nullptr);
static DeviceProfileInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class DeviceProfileInfo {
public:
explicit DeviceProfileInfo();
static DeviceProfileInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the identifier.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the identifier.
*/
void setJellyfinId(QString newJellyfinId);
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(DeviceProfileType type READ type WRITE setType NOTIFY typeChanged)
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
DeviceProfileType type() const;
void setType(DeviceProfileType newType);
signals:
void jellyfinIdChanged(QString newJellyfinId);
void nameChanged(QString newName);
void typeChanged(DeviceProfileType newType);
protected:
QString m_jellyfinId;
QString m_name;
DeviceProfileType m_type;
};
} // NS DTO
namespace Support {
using DeviceProfileInfo = Jellyfin::DTO::DeviceProfileInfo;
template <>
DeviceProfileInfo fromJsonValue<DeviceProfileInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DeviceProfileInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_DEVICEPROFILETYPE_H
#define JELLYFIN_DTO_DEVICEPROFILETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class DeviceProfileTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
System,
User,
};
@ -46,8 +51,31 @@ public:
private:
explicit DeviceProfileTypeClass();
};
typedef DeviceProfileTypeClass::Value DeviceProfileType;
} // NS DTO
namespace Support {
using DeviceProfileType = Jellyfin::DTO::DeviceProfileType;
using DeviceProfileTypeClass = Jellyfin::DTO::DeviceProfileTypeClass;
template <>
DeviceProfileType fromJsonValue<DeviceProfileType>(const QJsonValue &source) {
if (!source.isString()) return DeviceProfileTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("System")) {
return DeviceProfileTypeClass::System;
}
if (str == QStringLiteral("User")) {
return DeviceProfileTypeClass::User;
}
return DeviceProfileTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,44 +31,42 @@
#define JELLYFIN_DTO_DIRECTPLAYPROFILE_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/dlnaprofiletype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DirectPlayProfile : public QObject {
Q_OBJECT
public:
explicit DirectPlayProfile(QObject *parent = nullptr);
static DirectPlayProfile *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(QString container READ container WRITE setContainer NOTIFY containerChanged)
Q_PROPERTY(QString audioCodec READ audioCodec WRITE setAudioCodec NOTIFY audioCodecChanged)
Q_PROPERTY(QString videoCodec READ videoCodec WRITE setVideoCodec NOTIFY videoCodecChanged)
Q_PROPERTY(DlnaProfileType type READ type WRITE setType NOTIFY typeChanged)
class DirectPlayProfile {
public:
explicit DirectPlayProfile();
static DirectPlayProfile fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
QString container() const;
void setContainer(QString newContainer);
QString audioCodec() const;
void setAudioCodec(QString newAudioCodec);
QString videoCodec() const;
void setVideoCodec(QString newVideoCodec);
DlnaProfileType type() const;
void setType(DlnaProfileType newType);
signals:
void containerChanged(QString newContainer);
void audioCodecChanged(QString newAudioCodec);
void videoCodecChanged(QString newVideoCodec);
void typeChanged(DlnaProfileType newType);
protected:
QString m_container;
QString m_audioCodec;
@ -76,6 +74,18 @@ protected:
DlnaProfileType m_type;
};
} // NS DTO
namespace Support {
using DirectPlayProfile = Jellyfin::DTO::DirectPlayProfile;
template <>
DirectPlayProfile fromJsonValue<DirectPlayProfile>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DirectPlayProfile::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,131 +31,131 @@
#define JELLYFIN_DTO_DISPLAYPREFERENCESDTO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/scrolldirection.h"
#include "JellyfinQt/DTO/sortorder.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class DisplayPreferencesDto : public QObject {
Q_OBJECT
public:
explicit DisplayPreferencesDto(QObject *parent = nullptr);
static DisplayPreferencesDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class DisplayPreferencesDto {
public:
explicit DisplayPreferencesDto();
static DisplayPreferencesDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the user id.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
QString jellyfinId() const;
/**
* @brief Gets or sets the user id.
*/
void setJellyfinId(QString newJellyfinId);
/**
* @brief Gets or sets the type of the view.
*/
Q_PROPERTY(QString viewType READ viewType WRITE setViewType NOTIFY viewTypeChanged)
QString viewType() const;
/**
* @brief Gets or sets the type of the view.
*/
void setViewType(QString newViewType);
/**
* @brief Gets or sets the sort by.
*/
Q_PROPERTY(QString sortBy READ sortBy WRITE setSortBy NOTIFY sortByChanged)
QString sortBy() const;
/**
* @brief Gets or sets the sort by.
*/
void setSortBy(QString newSortBy);
/**
* @brief Gets or sets the index by.
*/
Q_PROPERTY(QString indexBy READ indexBy WRITE setIndexBy NOTIFY indexByChanged)
QString indexBy() const;
/**
* @brief Gets or sets the index by.
*/
void setIndexBy(QString newIndexBy);
/**
* @brief Gets or sets a value indicating whether [remember indexing].
*/
Q_PROPERTY(bool rememberIndexing READ rememberIndexing WRITE setRememberIndexing NOTIFY rememberIndexingChanged)
bool rememberIndexing() const;
/**
* @brief Gets or sets a value indicating whether [remember indexing].
*/
void setRememberIndexing(bool newRememberIndexing);
/**
* @brief Gets or sets the height of the primary image.
*/
Q_PROPERTY(qint32 primaryImageHeight READ primaryImageHeight WRITE setPrimaryImageHeight NOTIFY primaryImageHeightChanged)
qint32 primaryImageHeight() const;
/**
* @brief Gets or sets the height of the primary image.
*/
void setPrimaryImageHeight(qint32 newPrimaryImageHeight);
/**
* @brief Gets or sets the width of the primary image.
*/
Q_PROPERTY(qint32 primaryImageWidth READ primaryImageWidth WRITE setPrimaryImageWidth NOTIFY primaryImageWidthChanged)
qint32 primaryImageWidth() const;
/**
* @brief Gets or sets the width of the primary image.
*/
void setPrimaryImageWidth(qint32 newPrimaryImageWidth);
/**
* @brief Gets or sets the custom prefs.
*/
Q_PROPERTY(QJsonObject customPrefs READ customPrefs WRITE setCustomPrefs NOTIFY customPrefsChanged)
Q_PROPERTY(ScrollDirection scrollDirection READ scrollDirection WRITE setScrollDirection NOTIFY scrollDirectionChanged)
/**
* @brief Gets or sets a value indicating whether to show backdrops on this item.
*/
Q_PROPERTY(bool showBackdrop READ showBackdrop WRITE setShowBackdrop NOTIFY showBackdropChanged)
/**
* @brief Gets or sets a value indicating whether [remember sorting].
*/
Q_PROPERTY(bool rememberSorting READ rememberSorting WRITE setRememberSorting NOTIFY rememberSortingChanged)
Q_PROPERTY(SortOrder sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
/**
* @brief Gets or sets a value indicating whether [show sidebar].
*/
Q_PROPERTY(bool showSidebar READ showSidebar WRITE setShowSidebar NOTIFY showSidebarChanged)
/**
* @brief Gets or sets the client.
*/
Q_PROPERTY(QString client READ client WRITE setClient NOTIFY clientChanged)
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
QString viewType() const;
void setViewType(QString newViewType);
QString sortBy() const;
void setSortBy(QString newSortBy);
QString indexBy() const;
void setIndexBy(QString newIndexBy);
bool rememberIndexing() const;
void setRememberIndexing(bool newRememberIndexing);
qint32 primaryImageHeight() const;
void setPrimaryImageHeight(qint32 newPrimaryImageHeight);
qint32 primaryImageWidth() const;
void setPrimaryImageWidth(qint32 newPrimaryImageWidth);
QJsonObject customPrefs() const;
/**
* @brief Gets or sets the custom prefs.
*/
void setCustomPrefs(QJsonObject newCustomPrefs);
ScrollDirection scrollDirection() const;
void setScrollDirection(ScrollDirection newScrollDirection);
/**
* @brief Gets or sets a value indicating whether to show backdrops on this item.
*/
bool showBackdrop() const;
/**
* @brief Gets or sets a value indicating whether to show backdrops on this item.
*/
void setShowBackdrop(bool newShowBackdrop);
/**
* @brief Gets or sets a value indicating whether [remember sorting].
*/
bool rememberSorting() const;
/**
* @brief Gets or sets a value indicating whether [remember sorting].
*/
void setRememberSorting(bool newRememberSorting);
SortOrder sortOrder() const;
void setSortOrder(SortOrder newSortOrder);
/**
* @brief Gets or sets a value indicating whether [show sidebar].
*/
bool showSidebar() const;
/**
* @brief Gets or sets a value indicating whether [show sidebar].
*/
void setShowSidebar(bool newShowSidebar);
/**
* @brief Gets or sets the client.
*/
QString client() const;
/**
* @brief Gets or sets the client.
*/
void setClient(QString newClient);
signals:
void jellyfinIdChanged(QString newJellyfinId);
void viewTypeChanged(QString newViewType);
void sortByChanged(QString newSortBy);
void indexByChanged(QString newIndexBy);
void rememberIndexingChanged(bool newRememberIndexing);
void primaryImageHeightChanged(qint32 newPrimaryImageHeight);
void primaryImageWidthChanged(qint32 newPrimaryImageWidth);
void customPrefsChanged(QJsonObject newCustomPrefs);
void scrollDirectionChanged(ScrollDirection newScrollDirection);
void showBackdropChanged(bool newShowBackdrop);
void rememberSortingChanged(bool newRememberSorting);
void sortOrderChanged(SortOrder newSortOrder);
void showSidebarChanged(bool newShowSidebar);
void clientChanged(QString newClient);
protected:
QString m_jellyfinId;
QString m_viewType;
@ -173,6 +173,18 @@ protected:
QString m_client;
};
} // NS DTO
namespace Support {
using DisplayPreferencesDto = Jellyfin::DTO::DisplayPreferencesDto;
template <>
DisplayPreferencesDto fromJsonValue<DisplayPreferencesDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return DisplayPreferencesDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_DLNAPROFILETYPE_H
#define JELLYFIN_DTO_DLNAPROFILETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class DlnaProfileTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Audio,
Video,
Photo,
@ -47,8 +52,34 @@ public:
private:
explicit DlnaProfileTypeClass();
};
typedef DlnaProfileTypeClass::Value DlnaProfileType;
} // NS DTO
namespace Support {
using DlnaProfileType = Jellyfin::DTO::DlnaProfileType;
using DlnaProfileTypeClass = Jellyfin::DTO::DlnaProfileTypeClass;
template <>
DlnaProfileType fromJsonValue<DlnaProfileType>(const QJsonValue &source) {
if (!source.isString()) return DlnaProfileTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Audio")) {
return DlnaProfileTypeClass::Audio;
}
if (str == QStringLiteral("Video")) {
return DlnaProfileTypeClass::Video;
}
if (str == QStringLiteral("Photo")) {
return DlnaProfileTypeClass::Photo;
}
return DlnaProfileTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_DYNAMICDAYOFWEEK_H
#define JELLYFIN_DTO_DYNAMICDAYOFWEEK_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class DynamicDayOfWeekClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Sunday,
Monday,
Tuesday,
@ -54,8 +59,55 @@ public:
private:
explicit DynamicDayOfWeekClass();
};
typedef DynamicDayOfWeekClass::Value DynamicDayOfWeek;
} // NS DTO
namespace Support {
using DynamicDayOfWeek = Jellyfin::DTO::DynamicDayOfWeek;
using DynamicDayOfWeekClass = Jellyfin::DTO::DynamicDayOfWeekClass;
template <>
DynamicDayOfWeek fromJsonValue<DynamicDayOfWeek>(const QJsonValue &source) {
if (!source.isString()) return DynamicDayOfWeekClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Sunday")) {
return DynamicDayOfWeekClass::Sunday;
}
if (str == QStringLiteral("Monday")) {
return DynamicDayOfWeekClass::Monday;
}
if (str == QStringLiteral("Tuesday")) {
return DynamicDayOfWeekClass::Tuesday;
}
if (str == QStringLiteral("Wednesday")) {
return DynamicDayOfWeekClass::Wednesday;
}
if (str == QStringLiteral("Thursday")) {
return DynamicDayOfWeekClass::Thursday;
}
if (str == QStringLiteral("Friday")) {
return DynamicDayOfWeekClass::Friday;
}
if (str == QStringLiteral("Saturday")) {
return DynamicDayOfWeekClass::Saturday;
}
if (str == QStringLiteral("Everyday")) {
return DynamicDayOfWeekClass::Everyday;
}
if (str == QStringLiteral("Weekday")) {
return DynamicDayOfWeekClass::Weekday;
}
if (str == QStringLiteral("Weekend")) {
return DynamicDayOfWeekClass::Weekend;
}
return DynamicDayOfWeekClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_ENCODINGCONTEXT_H
#define JELLYFIN_DTO_ENCODINGCONTEXT_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class EncodingContextClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Streaming,
Static,
};
@ -46,8 +51,31 @@ public:
private:
explicit EncodingContextClass();
};
typedef EncodingContextClass::Value EncodingContext;
} // NS DTO
namespace Support {
using EncodingContext = Jellyfin::DTO::EncodingContext;
using EncodingContextClass = Jellyfin::DTO::EncodingContextClass;
template <>
EncodingContext fromJsonValue<EncodingContext>(const QJsonValue &source) {
if (!source.isString()) return EncodingContextClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Streaming")) {
return EncodingContextClass::Streaming;
}
if (str == QStringLiteral("Static")) {
return EncodingContextClass::Static;
}
return EncodingContextClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,36 +31,49 @@
#define JELLYFIN_DTO_ENDPOINTINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class EndPointInfo : public QObject {
Q_OBJECT
public:
explicit EndPointInfo(QObject *parent = nullptr);
static EndPointInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(bool isLocal READ isLocal WRITE setIsLocal NOTIFY isLocalChanged)
Q_PROPERTY(bool isInNetwork READ isInNetwork WRITE setIsInNetwork NOTIFY isInNetworkChanged)
class EndPointInfo {
public:
explicit EndPointInfo();
static EndPointInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
bool isLocal() const;
void setIsLocal(bool newIsLocal);
bool isInNetwork() const;
void setIsInNetwork(bool newIsInNetwork);
signals:
void isLocalChanged(bool newIsLocal);
void isInNetworkChanged(bool newIsInNetwork);
protected:
bool m_isLocal;
bool m_isInNetwork;
};
} // NS DTO
namespace Support {
using EndPointInfo = Jellyfin::DTO::EndPointInfo;
template <>
EndPointInfo fromJsonValue<EndPointInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return EndPointInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,53 +31,54 @@
#define JELLYFIN_DTO_EXTERNALIDINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/externalidmediatype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ExternalIdInfo : public QObject {
Q_OBJECT
public:
explicit ExternalIdInfo(QObject *parent = nullptr);
static ExternalIdInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ExternalIdInfo {
public:
explicit ExternalIdInfo();
static ExternalIdInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).
*/
void setName(QString newName);
/**
* @brief Gets or sets the unique key for this id. This key should be unique across all providers.
*/
Q_PROPERTY(QString key READ key WRITE setKey NOTIFY keyChanged)
Q_PROPERTY(ExternalIdMediaType type READ type WRITE setType NOTIFY typeChanged)
/**
* @brief Gets or sets the URL format string.
*/
Q_PROPERTY(QString urlFormatString READ urlFormatString WRITE setUrlFormatString NOTIFY urlFormatStringChanged)
QString name() const;
void setName(QString newName);
QString key() const;
/**
* @brief Gets or sets the unique key for this id. This key should be unique across all providers.
*/
void setKey(QString newKey);
ExternalIdMediaType type() const;
void setType(ExternalIdMediaType newType);
void setType(ExternalIdMediaType newType);
/**
* @brief Gets or sets the URL format string.
*/
QString urlFormatString() const;
/**
* @brief Gets or sets the URL format string.
*/
void setUrlFormatString(QString newUrlFormatString);
signals:
void nameChanged(QString newName);
void keyChanged(QString newKey);
void typeChanged(ExternalIdMediaType newType);
void urlFormatStringChanged(QString newUrlFormatString);
protected:
QString m_name;
QString m_key;
@ -85,6 +86,18 @@ protected:
QString m_urlFormatString;
};
} // NS DTO
namespace Support {
using ExternalIdInfo = Jellyfin::DTO::ExternalIdInfo;
template <>
ExternalIdInfo fromJsonValue<ExternalIdInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ExternalIdInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_EXTERNALIDMEDIATYPE_H
#define JELLYFIN_DTO_EXTERNALIDMEDIATYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ExternalIdMediaTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Album,
AlbumArtist,
Artist,
@ -56,8 +61,61 @@ public:
private:
explicit ExternalIdMediaTypeClass();
};
typedef ExternalIdMediaTypeClass::Value ExternalIdMediaType;
} // NS DTO
namespace Support {
using ExternalIdMediaType = Jellyfin::DTO::ExternalIdMediaType;
using ExternalIdMediaTypeClass = Jellyfin::DTO::ExternalIdMediaTypeClass;
template <>
ExternalIdMediaType fromJsonValue<ExternalIdMediaType>(const QJsonValue &source) {
if (!source.isString()) return ExternalIdMediaTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Album")) {
return ExternalIdMediaTypeClass::Album;
}
if (str == QStringLiteral("AlbumArtist")) {
return ExternalIdMediaTypeClass::AlbumArtist;
}
if (str == QStringLiteral("Artist")) {
return ExternalIdMediaTypeClass::Artist;
}
if (str == QStringLiteral("BoxSet")) {
return ExternalIdMediaTypeClass::BoxSet;
}
if (str == QStringLiteral("Episode")) {
return ExternalIdMediaTypeClass::Episode;
}
if (str == QStringLiteral("Movie")) {
return ExternalIdMediaTypeClass::Movie;
}
if (str == QStringLiteral("OtherArtist")) {
return ExternalIdMediaTypeClass::OtherArtist;
}
if (str == QStringLiteral("Person")) {
return ExternalIdMediaTypeClass::Person;
}
if (str == QStringLiteral("ReleaseGroup")) {
return ExternalIdMediaTypeClass::ReleaseGroup;
}
if (str == QStringLiteral("Season")) {
return ExternalIdMediaTypeClass::Season;
}
if (str == QStringLiteral("Series")) {
return ExternalIdMediaTypeClass::Series;
}
if (str == QStringLiteral("Track")) {
return ExternalIdMediaTypeClass::Track;
}
return ExternalIdMediaTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,43 +31,58 @@
#define JELLYFIN_DTO_EXTERNALURL_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ExternalUrl : public QObject {
Q_OBJECT
public:
explicit ExternalUrl(QObject *parent = nullptr);
static ExternalUrl *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ExternalUrl {
public:
explicit ExternalUrl();
static ExternalUrl fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the type of the item.
*/
Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
QString name() const;
void setName(QString newName);
QString url() const;
/**
* @brief Gets or sets the type of the item.
*/
void setUrl(QString newUrl);
signals:
void nameChanged(QString newName);
void urlChanged(QString newUrl);
protected:
QString m_name;
QString m_url;
};
} // NS DTO
namespace Support {
using ExternalUrl = Jellyfin::DTO::ExternalUrl;
template <>
ExternalUrl fromJsonValue<ExternalUrl>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ExternalUrl::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_FFMPEGLOCATION_H
#define JELLYFIN_DTO_FFMPEGLOCATION_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class FFmpegLocationClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
NotFound,
SetByArgument,
Custom,
@ -48,8 +53,37 @@ public:
private:
explicit FFmpegLocationClass();
};
typedef FFmpegLocationClass::Value FFmpegLocation;
} // NS DTO
namespace Support {
using FFmpegLocation = Jellyfin::DTO::FFmpegLocation;
using FFmpegLocationClass = Jellyfin::DTO::FFmpegLocationClass;
template <>
FFmpegLocation fromJsonValue<FFmpegLocation>(const QJsonValue &source) {
if (!source.isString()) return FFmpegLocationClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("NotFound")) {
return FFmpegLocationClass::NotFound;
}
if (str == QStringLiteral("SetByArgument")) {
return FFmpegLocationClass::SetByArgument;
}
if (str == QStringLiteral("Custom")) {
return FFmpegLocationClass::Custom;
}
if (str == QStringLiteral("System")) {
return FFmpegLocationClass::System;
}
return FFmpegLocationClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,51 +31,64 @@
#define JELLYFIN_DTO_FILESYSTEMENTRYINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/filesystementrytype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class FileSystemEntryInfo : public QObject {
Q_OBJECT
public:
explicit FileSystemEntryInfo(QObject *parent = nullptr);
static FileSystemEntryInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class FileSystemEntryInfo {
public:
explicit FileSystemEntryInfo();
static FileSystemEntryInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets the name.
*/
void setName(QString newName);
/**
* @brief Gets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(FileSystemEntryType type READ type WRITE setType NOTIFY typeChanged)
QString name() const;
void setName(QString newName);
QString path() const;
/**
* @brief Gets the path.
*/
void setPath(QString newPath);
FileSystemEntryType type() const;
void setType(FileSystemEntryType newType);
signals:
void nameChanged(QString newName);
void pathChanged(QString newPath);
void typeChanged(FileSystemEntryType newType);
protected:
QString m_name;
QString m_path;
FileSystemEntryType m_type;
};
} // NS DTO
namespace Support {
using FileSystemEntryInfo = Jellyfin::DTO::FileSystemEntryInfo;
template <>
FileSystemEntryInfo fromJsonValue<FileSystemEntryInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return FileSystemEntryInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_FILESYSTEMENTRYTYPE_H
#define JELLYFIN_DTO_FILESYSTEMENTRYTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class FileSystemEntryTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
File,
Directory,
NetworkComputer,
@ -48,8 +53,37 @@ public:
private:
explicit FileSystemEntryTypeClass();
};
typedef FileSystemEntryTypeClass::Value FileSystemEntryType;
} // NS DTO
namespace Support {
using FileSystemEntryType = Jellyfin::DTO::FileSystemEntryType;
using FileSystemEntryTypeClass = Jellyfin::DTO::FileSystemEntryTypeClass;
template <>
FileSystemEntryType fromJsonValue<FileSystemEntryType>(const QJsonValue &source) {
if (!source.isString()) return FileSystemEntryTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("File")) {
return FileSystemEntryTypeClass::File;
}
if (str == QStringLiteral("Directory")) {
return FileSystemEntryTypeClass::Directory;
}
if (str == QStringLiteral("NetworkComputer")) {
return FileSystemEntryTypeClass::NetworkComputer;
}
if (str == QStringLiteral("NetworkShare")) {
return FileSystemEntryTypeClass::NetworkShare;
}
return FileSystemEntryTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,54 +32,57 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class FontFile : public QObject {
Q_OBJECT
public:
explicit FontFile(QObject *parent = nullptr);
static FontFile *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class FontFile {
public:
explicit FontFile();
static FontFile fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the size.
*/
Q_PROPERTY(qint64 size READ size WRITE setSize NOTIFY sizeChanged)
qint64 size() const;
/**
* @brief Gets or sets the size.
*/
void setSize(qint64 newSize);
/**
* @brief Gets or sets the date created.
*/
Q_PROPERTY(QDateTime dateCreated READ dateCreated WRITE setDateCreated NOTIFY dateCreatedChanged)
QDateTime dateCreated() const;
/**
* @brief Gets or sets the date created.
*/
void setDateCreated(QDateTime newDateCreated);
/**
* @brief Gets or sets the date modified.
*/
Q_PROPERTY(QDateTime dateModified READ dateModified WRITE setDateModified NOTIFY dateModifiedChanged)
QString name() const;
void setName(QString newName);
qint64 size() const;
void setSize(qint64 newSize);
QDateTime dateCreated() const;
void setDateCreated(QDateTime newDateCreated);
QDateTime dateModified() const;
/**
* @brief Gets or sets the date modified.
*/
void setDateModified(QDateTime newDateModified);
signals:
void nameChanged(QString newName);
void sizeChanged(qint64 newSize);
void dateCreatedChanged(QDateTime newDateCreated);
void dateModifiedChanged(QDateTime newDateModified);
protected:
QString m_name;
qint64 m_size;
@ -87,6 +90,18 @@ protected:
QDateTime m_dateModified;
};
} // NS DTO
namespace Support {
using FontFile = Jellyfin::DTO::FontFile;
template <>
FontFile fromJsonValue<FontFile>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return FontFile::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_FORGOTPASSWORDACTION_H
#define JELLYFIN_DTO_FORGOTPASSWORDACTION_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ForgotPasswordActionClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
ContactAdmin,
PinCode,
InNetworkRequired,
@ -47,8 +52,34 @@ public:
private:
explicit ForgotPasswordActionClass();
};
typedef ForgotPasswordActionClass::Value ForgotPasswordAction;
} // NS DTO
namespace Support {
using ForgotPasswordAction = Jellyfin::DTO::ForgotPasswordAction;
using ForgotPasswordActionClass = Jellyfin::DTO::ForgotPasswordActionClass;
template <>
ForgotPasswordAction fromJsonValue<ForgotPasswordAction>(const QJsonValue &source) {
if (!source.isString()) return ForgotPasswordActionClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("ContactAdmin")) {
return ForgotPasswordActionClass::ContactAdmin;
}
if (str == QStringLiteral("PinCode")) {
return ForgotPasswordActionClass::PinCode;
}
if (str == QStringLiteral("InNetworkRequired")) {
return ForgotPasswordActionClass::InNetworkRequired;
}
return ForgotPasswordActionClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,34 +31,49 @@
#define JELLYFIN_DTO_FORGOTPASSWORDDTO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ForgotPasswordDto : public QObject {
Q_OBJECT
public:
explicit ForgotPasswordDto(QObject *parent = nullptr);
static ForgotPasswordDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ForgotPasswordDto {
public:
explicit ForgotPasswordDto();
static ForgotPasswordDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the entered username to have its password reset.
*/
Q_PROPERTY(QString enteredUsername READ enteredUsername WRITE setEnteredUsername NOTIFY enteredUsernameChanged)
QString enteredUsername() const;
/**
* @brief Gets or sets the entered username to have its password reset.
*/
void setEnteredUsername(QString newEnteredUsername);
signals:
void enteredUsernameChanged(QString newEnteredUsername);
protected:
QString m_enteredUsername;
};
} // NS DTO
namespace Support {
using ForgotPasswordDto = Jellyfin::DTO::ForgotPasswordDto;
template <>
ForgotPasswordDto fromJsonValue<ForgotPasswordDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ForgotPasswordDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,51 +32,64 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/forgotpasswordaction.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ForgotPasswordResult : public QObject {
Q_OBJECT
public:
explicit ForgotPasswordResult(QObject *parent = nullptr);
static ForgotPasswordResult *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(ForgotPasswordAction action READ action WRITE setAction NOTIFY actionChanged)
class ForgotPasswordResult {
public:
explicit ForgotPasswordResult();
static ForgotPasswordResult fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
ForgotPasswordAction action() const;
void setAction(ForgotPasswordAction newAction);
/**
* @brief Gets or sets the pin file.
*/
Q_PROPERTY(QString pinFile READ pinFile WRITE setPinFile NOTIFY pinFileChanged)
QString pinFile() const;
/**
* @brief Gets or sets the pin file.
*/
void setPinFile(QString newPinFile);
/**
* @brief Gets or sets the pin expiration date.
*/
Q_PROPERTY(QDateTime pinExpirationDate READ pinExpirationDate WRITE setPinExpirationDate NOTIFY pinExpirationDateChanged)
ForgotPasswordAction action() const;
void setAction(ForgotPasswordAction newAction);
QString pinFile() const;
void setPinFile(QString newPinFile);
QDateTime pinExpirationDate() const;
/**
* @brief Gets or sets the pin expiration date.
*/
void setPinExpirationDate(QDateTime newPinExpirationDate);
signals:
void actionChanged(ForgotPasswordAction newAction);
void pinFileChanged(QString newPinFile);
void pinExpirationDateChanged(QDateTime newPinExpirationDate);
protected:
ForgotPasswordAction m_action;
QString m_pinFile;
QDateTime m_pinExpirationDate;
};
} // NS DTO
namespace Support {
using ForgotPasswordResult = Jellyfin::DTO::ForgotPasswordResult;
template <>
ForgotPasswordResult fromJsonValue<ForgotPasswordResult>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ForgotPasswordResult::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,45 +31,56 @@
#define JELLYFIN_DTO_GENERALCOMMAND_H
#include <QJsonObject>
#include <QObject>
#include <QString>
#include <QJsonValue>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/generalcommandtype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class GeneralCommand : public QObject {
Q_OBJECT
public:
explicit GeneralCommand(QObject *parent = nullptr);
static GeneralCommand *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(GeneralCommandType name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString controllingUserId READ controllingUserId WRITE setControllingUserId NOTIFY controllingUserIdChanged)
Q_PROPERTY(QJsonObject arguments READ arguments WRITE setArguments NOTIFY argumentsChanged)
class GeneralCommand {
public:
explicit GeneralCommand();
static GeneralCommand fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
GeneralCommandType name() const;
void setName(GeneralCommandType newName);
QString controllingUserId() const;
void setControllingUserId(QString newControllingUserId);
QUuid controllingUserId() const;
void setControllingUserId(QUuid newControllingUserId);
QJsonObject arguments() const;
void setArguments(QJsonObject newArguments);
signals:
void nameChanged(GeneralCommandType newName);
void controllingUserIdChanged(QString newControllingUserId);
void argumentsChanged(QJsonObject newArguments);
protected:
GeneralCommandType m_name;
QString m_controllingUserId;
QUuid m_controllingUserId;
QJsonObject m_arguments;
};
} // NS DTO
namespace Support {
using GeneralCommand = Jellyfin::DTO::GeneralCommand;
template <>
GeneralCommand fromJsonValue<GeneralCommand>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return GeneralCommand::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GENERALCOMMANDTYPE_H
#define JELLYFIN_DTO_GENERALCOMMANDTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GeneralCommandTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
MoveUp,
MoveDown,
MoveLeft,
@ -85,8 +90,148 @@ public:
private:
explicit GeneralCommandTypeClass();
};
typedef GeneralCommandTypeClass::Value GeneralCommandType;
} // NS DTO
namespace Support {
using GeneralCommandType = Jellyfin::DTO::GeneralCommandType;
using GeneralCommandTypeClass = Jellyfin::DTO::GeneralCommandTypeClass;
template <>
GeneralCommandType fromJsonValue<GeneralCommandType>(const QJsonValue &source) {
if (!source.isString()) return GeneralCommandTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("MoveUp")) {
return GeneralCommandTypeClass::MoveUp;
}
if (str == QStringLiteral("MoveDown")) {
return GeneralCommandTypeClass::MoveDown;
}
if (str == QStringLiteral("MoveLeft")) {
return GeneralCommandTypeClass::MoveLeft;
}
if (str == QStringLiteral("MoveRight")) {
return GeneralCommandTypeClass::MoveRight;
}
if (str == QStringLiteral("PageUp")) {
return GeneralCommandTypeClass::PageUp;
}
if (str == QStringLiteral("PageDown")) {
return GeneralCommandTypeClass::PageDown;
}
if (str == QStringLiteral("PreviousLetter")) {
return GeneralCommandTypeClass::PreviousLetter;
}
if (str == QStringLiteral("NextLetter")) {
return GeneralCommandTypeClass::NextLetter;
}
if (str == QStringLiteral("ToggleOsd")) {
return GeneralCommandTypeClass::ToggleOsd;
}
if (str == QStringLiteral("ToggleContextMenu")) {
return GeneralCommandTypeClass::ToggleContextMenu;
}
if (str == QStringLiteral("Select")) {
return GeneralCommandTypeClass::Select;
}
if (str == QStringLiteral("Back")) {
return GeneralCommandTypeClass::Back;
}
if (str == QStringLiteral("TakeScreenshot")) {
return GeneralCommandTypeClass::TakeScreenshot;
}
if (str == QStringLiteral("SendKey")) {
return GeneralCommandTypeClass::SendKey;
}
if (str == QStringLiteral("SendString")) {
return GeneralCommandTypeClass::SendString;
}
if (str == QStringLiteral("GoHome")) {
return GeneralCommandTypeClass::GoHome;
}
if (str == QStringLiteral("GoToSettings")) {
return GeneralCommandTypeClass::GoToSettings;
}
if (str == QStringLiteral("VolumeUp")) {
return GeneralCommandTypeClass::VolumeUp;
}
if (str == QStringLiteral("VolumeDown")) {
return GeneralCommandTypeClass::VolumeDown;
}
if (str == QStringLiteral("Mute")) {
return GeneralCommandTypeClass::Mute;
}
if (str == QStringLiteral("Unmute")) {
return GeneralCommandTypeClass::Unmute;
}
if (str == QStringLiteral("ToggleMute")) {
return GeneralCommandTypeClass::ToggleMute;
}
if (str == QStringLiteral("SetVolume")) {
return GeneralCommandTypeClass::SetVolume;
}
if (str == QStringLiteral("SetAudioStreamIndex")) {
return GeneralCommandTypeClass::SetAudioStreamIndex;
}
if (str == QStringLiteral("SetSubtitleStreamIndex")) {
return GeneralCommandTypeClass::SetSubtitleStreamIndex;
}
if (str == QStringLiteral("ToggleFullscreen")) {
return GeneralCommandTypeClass::ToggleFullscreen;
}
if (str == QStringLiteral("DisplayContent")) {
return GeneralCommandTypeClass::DisplayContent;
}
if (str == QStringLiteral("GoToSearch")) {
return GeneralCommandTypeClass::GoToSearch;
}
if (str == QStringLiteral("DisplayMessage")) {
return GeneralCommandTypeClass::DisplayMessage;
}
if (str == QStringLiteral("SetRepeatMode")) {
return GeneralCommandTypeClass::SetRepeatMode;
}
if (str == QStringLiteral("ChannelUp")) {
return GeneralCommandTypeClass::ChannelUp;
}
if (str == QStringLiteral("ChannelDown")) {
return GeneralCommandTypeClass::ChannelDown;
}
if (str == QStringLiteral("Guide")) {
return GeneralCommandTypeClass::Guide;
}
if (str == QStringLiteral("ToggleStats")) {
return GeneralCommandTypeClass::ToggleStats;
}
if (str == QStringLiteral("PlayMediaSource")) {
return GeneralCommandTypeClass::PlayMediaSource;
}
if (str == QStringLiteral("PlayTrailers")) {
return GeneralCommandTypeClass::PlayTrailers;
}
if (str == QStringLiteral("SetShuffleQueue")) {
return GeneralCommandTypeClass::SetShuffleQueue;
}
if (str == QStringLiteral("PlayState")) {
return GeneralCommandTypeClass::PlayState;
}
if (str == QStringLiteral("PlayNext")) {
return GeneralCommandTypeClass::PlayNext;
}
if (str == QStringLiteral("ToggleOsdMenu")) {
return GeneralCommandTypeClass::ToggleOsdMenu;
}
if (str == QStringLiteral("Play")) {
return GeneralCommandTypeClass::Play;
}
return GeneralCommandTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,267 +32,291 @@
#include <QDateTime>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/imagetype.h"
#include "JellyfinQt/DTO/itemfields.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class GetProgramsDto : public QObject {
Q_OBJECT
public:
explicit GetProgramsDto(QObject *parent = nullptr);
static GetProgramsDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class GetProgramsDto {
public:
explicit GetProgramsDto();
static GetProgramsDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the channels to return guide information for.
*/
Q_PROPERTY(QStringList channelIds READ channelIds WRITE setChannelIds NOTIFY channelIdsChanged)
QList<QUuid> channelIds() const;
/**
* @brief Gets or sets the channels to return guide information for.
*/
void setChannelIds(QList<QUuid> newChannelIds);
/**
* @brief Gets or sets optional. Filter by user id.
*/
Q_PROPERTY(QString userId READ userId WRITE setUserId NOTIFY userIdChanged)
QUuid userId() const;
/**
* @brief Gets or sets optional. Filter by user id.
*/
void setUserId(QUuid newUserId);
/**
* @brief Gets or sets the minimum premiere start date.
Optional.
*/
Q_PROPERTY(QDateTime minStartDate READ minStartDate WRITE setMinStartDate NOTIFY minStartDateChanged)
QDateTime minStartDate() const;
/**
* @brief Gets or sets the minimum premiere start date.
Optional.
*/
void setMinStartDate(QDateTime newMinStartDate);
/**
* @brief Gets or sets filter by programs that have completed airing, or not.
Optional.
*/
Q_PROPERTY(bool hasAired READ hasAired WRITE setHasAired NOTIFY hasAiredChanged)
bool hasAired() const;
/**
* @brief Gets or sets filter by programs that have completed airing, or not.
Optional.
*/
void setHasAired(bool newHasAired);
/**
* @brief Gets or sets filter by programs that are currently airing, or not.
Optional.
*/
Q_PROPERTY(bool isAiring READ isAiring WRITE setIsAiring NOTIFY isAiringChanged)
bool isAiring() const;
/**
* @brief Gets or sets filter by programs that are currently airing, or not.
Optional.
*/
void setIsAiring(bool newIsAiring);
/**
* @brief Gets or sets the maximum premiere start date.
Optional.
*/
Q_PROPERTY(QDateTime maxStartDate READ maxStartDate WRITE setMaxStartDate NOTIFY maxStartDateChanged)
QDateTime maxStartDate() const;
/**
* @brief Gets or sets the maximum premiere start date.
Optional.
*/
void setMaxStartDate(QDateTime newMaxStartDate);
/**
* @brief Gets or sets the minimum premiere end date.
Optional.
*/
Q_PROPERTY(QDateTime minEndDate READ minEndDate WRITE setMinEndDate NOTIFY minEndDateChanged)
QDateTime minEndDate() const;
/**
* @brief Gets or sets the minimum premiere end date.
Optional.
*/
void setMinEndDate(QDateTime newMinEndDate);
/**
* @brief Gets or sets the maximum premiere end date.
Optional.
*/
Q_PROPERTY(QDateTime maxEndDate READ maxEndDate WRITE setMaxEndDate NOTIFY maxEndDateChanged)
QDateTime maxEndDate() const;
/**
* @brief Gets or sets the maximum premiere end date.
Optional.
*/
void setMaxEndDate(QDateTime newMaxEndDate);
/**
* @brief Gets or sets filter for movies.
Optional.
*/
Q_PROPERTY(bool isMovie READ isMovie WRITE setIsMovie NOTIFY isMovieChanged)
bool isMovie() const;
/**
* @brief Gets or sets filter for movies.
Optional.
*/
void setIsMovie(bool newIsMovie);
/**
* @brief Gets or sets filter for series.
Optional.
*/
Q_PROPERTY(bool isSeries READ isSeries WRITE setIsSeries NOTIFY isSeriesChanged)
bool isSeries() const;
/**
* @brief Gets or sets filter for series.
Optional.
*/
void setIsSeries(bool newIsSeries);
/**
* @brief Gets or sets filter for news.
Optional.
*/
Q_PROPERTY(bool isNews READ isNews WRITE setIsNews NOTIFY isNewsChanged)
bool isNews() const;
/**
* @brief Gets or sets filter for news.
Optional.
*/
void setIsNews(bool newIsNews);
/**
* @brief Gets or sets filter for kids.
Optional.
*/
Q_PROPERTY(bool isKids READ isKids WRITE setIsKids NOTIFY isKidsChanged)
bool isKids() const;
/**
* @brief Gets or sets filter for kids.
Optional.
*/
void setIsKids(bool newIsKids);
/**
* @brief Gets or sets filter for sports.
Optional.
*/
Q_PROPERTY(bool isSports READ isSports WRITE setIsSports NOTIFY isSportsChanged)
bool isSports() const;
/**
* @brief Gets or sets filter for sports.
Optional.
*/
void setIsSports(bool newIsSports);
/**
* @brief Gets or sets the record index to start at. All items with a lower index will be dropped from the results.
Optional.
*/
Q_PROPERTY(qint32 startIndex READ startIndex WRITE setStartIndex NOTIFY startIndexChanged)
qint32 startIndex() const;
/**
* @brief Gets or sets the record index to start at. All items with a lower index will be dropped from the results.
Optional.
*/
void setStartIndex(qint32 newStartIndex);
/**
* @brief Gets or sets the maximum number of records to return.
Optional.
*/
Q_PROPERTY(qint32 limit READ limit WRITE setLimit NOTIFY limitChanged)
qint32 limit() const;
/**
* @brief Gets or sets the maximum number of records to return.
Optional.
*/
void setLimit(qint32 newLimit);
/**
* @brief Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.
Optional.
*/
Q_PROPERTY(QString sortBy READ sortBy WRITE setSortBy NOTIFY sortByChanged)
QString sortBy() const;
/**
* @brief Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.
Optional.
*/
void setSortBy(QString newSortBy);
/**
* @brief Gets or sets sort Order - Ascending,Descending.
*/
Q_PROPERTY(QString sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
QString sortOrder() const;
/**
* @brief Gets or sets sort Order - Ascending,Descending.
*/
void setSortOrder(QString newSortOrder);
/**
* @brief Gets or sets the genres to return guide information for.
*/
Q_PROPERTY(QStringList genres READ genres WRITE setGenres NOTIFY genresChanged)
QStringList genres() const;
/**
* @brief Gets or sets the genres to return guide information for.
*/
void setGenres(QStringList newGenres);
/**
* @brief Gets or sets the genre ids to return guide information for.
*/
Q_PROPERTY(QStringList genreIds READ genreIds WRITE setGenreIds NOTIFY genreIdsChanged)
QList<QUuid> genreIds() const;
/**
* @brief Gets or sets the genre ids to return guide information for.
*/
void setGenreIds(QList<QUuid> newGenreIds);
/**
* @brief Gets or sets include image information in output.
Optional.
*/
Q_PROPERTY(bool enableImages READ enableImages WRITE setEnableImages NOTIFY enableImagesChanged)
bool enableImages() const;
/**
* @brief Gets or sets include image information in output.
Optional.
*/
void setEnableImages(bool newEnableImages);
/**
* @brief Gets or sets a value indicating whether retrieve total record count.
*/
Q_PROPERTY(bool enableTotalRecordCount READ enableTotalRecordCount WRITE setEnableTotalRecordCount NOTIFY enableTotalRecordCountChanged)
bool enableTotalRecordCount() const;
/**
* @brief Gets or sets a value indicating whether retrieve total record count.
*/
void setEnableTotalRecordCount(bool newEnableTotalRecordCount);
/**
* @brief Gets or sets the max number of images to return, per image type.
Optional.
*/
Q_PROPERTY(qint32 imageTypeLimit READ imageTypeLimit WRITE setImageTypeLimit NOTIFY imageTypeLimitChanged)
qint32 imageTypeLimit() const;
/**
* @brief Gets or sets the max number of images to return, per image type.
Optional.
*/
void setImageTypeLimit(qint32 newImageTypeLimit);
/**
* @brief Gets or sets the image types to include in the output.
Optional.
*/
Q_PROPERTY(QList<ImageType> enableImageTypes READ enableImageTypes WRITE setEnableImageTypes NOTIFY enableImageTypesChanged)
QList<ImageType> enableImageTypes() const;
/**
* @brief Gets or sets the image types to include in the output.
Optional.
*/
void setEnableImageTypes(QList<ImageType> newEnableImageTypes);
/**
* @brief Gets or sets include user data.
Optional.
*/
Q_PROPERTY(bool enableUserData READ enableUserData WRITE setEnableUserData NOTIFY enableUserDataChanged)
bool enableUserData() const;
/**
* @brief Gets or sets include user data.
Optional.
*/
void setEnableUserData(bool newEnableUserData);
/**
* @brief Gets or sets filter by series timer id.
Optional.
*/
Q_PROPERTY(QString seriesTimerId READ seriesTimerId WRITE setSeriesTimerId NOTIFY seriesTimerIdChanged)
QString seriesTimerId() const;
/**
* @brief Gets or sets filter by series timer id.
Optional.
*/
void setSeriesTimerId(QString newSeriesTimerId);
/**
* @brief Gets or sets filter by library series id.
Optional.
*/
Q_PROPERTY(QString librarySeriesId READ librarySeriesId WRITE setLibrarySeriesId NOTIFY librarySeriesIdChanged)
QUuid librarySeriesId() const;
/**
* @brief Gets or sets filter by library series id.
Optional.
*/
void setLibrarySeriesId(QUuid newLibrarySeriesId);
/**
* @brief Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
Optional.
*/
Q_PROPERTY(QList<ItemFields> fields READ fields WRITE setFields NOTIFY fieldsChanged)
QStringList channelIds() const;
void setChannelIds(QStringList newChannelIds);
QString userId() const;
void setUserId(QString newUserId);
QDateTime minStartDate() const;
void setMinStartDate(QDateTime newMinStartDate);
bool hasAired() const;
void setHasAired(bool newHasAired);
bool isAiring() const;
void setIsAiring(bool newIsAiring);
QDateTime maxStartDate() const;
void setMaxStartDate(QDateTime newMaxStartDate);
QDateTime minEndDate() const;
void setMinEndDate(QDateTime newMinEndDate);
QDateTime maxEndDate() const;
void setMaxEndDate(QDateTime newMaxEndDate);
bool isMovie() const;
void setIsMovie(bool newIsMovie);
bool isSeries() const;
void setIsSeries(bool newIsSeries);
bool isNews() const;
void setIsNews(bool newIsNews);
bool isKids() const;
void setIsKids(bool newIsKids);
bool isSports() const;
void setIsSports(bool newIsSports);
qint32 startIndex() const;
void setStartIndex(qint32 newStartIndex);
qint32 limit() const;
void setLimit(qint32 newLimit);
QString sortBy() const;
void setSortBy(QString newSortBy);
QString sortOrder() const;
void setSortOrder(QString newSortOrder);
QStringList genres() const;
void setGenres(QStringList newGenres);
QStringList genreIds() const;
void setGenreIds(QStringList newGenreIds);
bool enableImages() const;
void setEnableImages(bool newEnableImages);
bool enableTotalRecordCount() const;
void setEnableTotalRecordCount(bool newEnableTotalRecordCount);
qint32 imageTypeLimit() const;
void setImageTypeLimit(qint32 newImageTypeLimit);
QList<ImageType> enableImageTypes() const;
void setEnableImageTypes(QList<ImageType> newEnableImageTypes);
bool enableUserData() const;
void setEnableUserData(bool newEnableUserData);
QString seriesTimerId() const;
void setSeriesTimerId(QString newSeriesTimerId);
QString librarySeriesId() const;
void setLibrarySeriesId(QString newLibrarySeriesId);
QList<ItemFields> fields() const;
/**
* @brief Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
Optional.
*/
void setFields(QList<ItemFields> newFields);
signals:
void channelIdsChanged(QStringList newChannelIds);
void userIdChanged(QString newUserId);
void minStartDateChanged(QDateTime newMinStartDate);
void hasAiredChanged(bool newHasAired);
void isAiringChanged(bool newIsAiring);
void maxStartDateChanged(QDateTime newMaxStartDate);
void minEndDateChanged(QDateTime newMinEndDate);
void maxEndDateChanged(QDateTime newMaxEndDate);
void isMovieChanged(bool newIsMovie);
void isSeriesChanged(bool newIsSeries);
void isNewsChanged(bool newIsNews);
void isKidsChanged(bool newIsKids);
void isSportsChanged(bool newIsSports);
void startIndexChanged(qint32 newStartIndex);
void limitChanged(qint32 newLimit);
void sortByChanged(QString newSortBy);
void sortOrderChanged(QString newSortOrder);
void genresChanged(QStringList newGenres);
void genreIdsChanged(QStringList newGenreIds);
void enableImagesChanged(bool newEnableImages);
void enableTotalRecordCountChanged(bool newEnableTotalRecordCount);
void imageTypeLimitChanged(qint32 newImageTypeLimit);
void enableImageTypesChanged(QList<ImageType> newEnableImageTypes);
void enableUserDataChanged(bool newEnableUserData);
void seriesTimerIdChanged(QString newSeriesTimerId);
void librarySeriesIdChanged(QString newLibrarySeriesId);
void fieldsChanged(QList<ItemFields> newFields);
protected:
QStringList m_channelIds;
QString m_userId;
QList<QUuid> m_channelIds;
QUuid m_userId;
QDateTime m_minStartDate;
bool m_hasAired;
bool m_isAiring;
@ -309,17 +333,29 @@ protected:
QString m_sortBy;
QString m_sortOrder;
QStringList m_genres;
QStringList m_genreIds;
QList<QUuid> m_genreIds;
bool m_enableImages;
bool m_enableTotalRecordCount;
qint32 m_imageTypeLimit;
QList<ImageType> m_enableImageTypes;
bool m_enableUserData;
QString m_seriesTimerId;
QString m_librarySeriesId;
QUuid m_librarySeriesId;
QList<ItemFields> m_fields;
};
} // NS DTO
namespace Support {
using GetProgramsDto = Jellyfin::DTO::GetProgramsDto;
template <>
GetProgramsDto fromJsonValue<GetProgramsDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return GetProgramsDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,71 +32,85 @@
#include <QDateTime>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/groupstatetype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class GroupInfoDto : public QObject {
Q_OBJECT
public:
explicit GroupInfoDto(QObject *parent = nullptr);
static GroupInfoDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class GroupInfoDto {
public:
explicit GroupInfoDto();
static GroupInfoDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets the group identifier.
*/
Q_PROPERTY(QString groupId READ groupId WRITE setGroupId NOTIFY groupIdChanged)
QUuid groupId() const;
/**
* @brief Gets the group identifier.
*/
void setGroupId(QUuid newGroupId);
/**
* @brief Gets the group name.
*/
Q_PROPERTY(QString groupName READ groupName WRITE setGroupName NOTIFY groupNameChanged)
Q_PROPERTY(GroupStateType state READ state WRITE setState NOTIFY stateChanged)
/**
* @brief Gets the participants.
*/
Q_PROPERTY(QStringList participants READ participants WRITE setParticipants NOTIFY participantsChanged)
/**
* @brief Gets the date when this DTO has been created.
*/
Q_PROPERTY(QDateTime lastUpdatedAt READ lastUpdatedAt WRITE setLastUpdatedAt NOTIFY lastUpdatedAtChanged)
QString groupId() const;
void setGroupId(QString newGroupId);
QString groupName() const;
/**
* @brief Gets the group name.
*/
void setGroupName(QString newGroupName);
GroupStateType state() const;
void setState(GroupStateType newState);
/**
* @brief Gets the participants.
*/
QStringList participants() const;
/**
* @brief Gets the participants.
*/
void setParticipants(QStringList newParticipants);
/**
* @brief Gets the date when this DTO has been created.
*/
QDateTime lastUpdatedAt() const;
/**
* @brief Gets the date when this DTO has been created.
*/
void setLastUpdatedAt(QDateTime newLastUpdatedAt);
signals:
void groupIdChanged(QString newGroupId);
void groupNameChanged(QString newGroupName);
void stateChanged(GroupStateType newState);
void participantsChanged(QStringList newParticipants);
void lastUpdatedAtChanged(QDateTime newLastUpdatedAt);
protected:
QString m_groupId;
QUuid m_groupId;
QString m_groupName;
GroupStateType m_state;
QStringList m_participants;
QDateTime m_lastUpdatedAt;
};
} // NS DTO
namespace Support {
using GroupInfoDto = Jellyfin::DTO::GroupInfoDto;
template <>
GroupInfoDto fromJsonValue<GroupInfoDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return GroupInfoDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GROUPQUEUEMODE_H
#define JELLYFIN_DTO_GROUPQUEUEMODE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GroupQueueModeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Queue,
QueueNext,
};
@ -46,8 +51,31 @@ public:
private:
explicit GroupQueueModeClass();
};
typedef GroupQueueModeClass::Value GroupQueueMode;
} // NS DTO
namespace Support {
using GroupQueueMode = Jellyfin::DTO::GroupQueueMode;
using GroupQueueModeClass = Jellyfin::DTO::GroupQueueModeClass;
template <>
GroupQueueMode fromJsonValue<GroupQueueMode>(const QJsonValue &source) {
if (!source.isString()) return GroupQueueModeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Queue")) {
return GroupQueueModeClass::Queue;
}
if (str == QStringLiteral("QueueNext")) {
return GroupQueueModeClass::QueueNext;
}
return GroupQueueModeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GROUPREPEATMODE_H
#define JELLYFIN_DTO_GROUPREPEATMODE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GroupRepeatModeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
RepeatOne,
RepeatAll,
RepeatNone,
@ -47,8 +52,34 @@ public:
private:
explicit GroupRepeatModeClass();
};
typedef GroupRepeatModeClass::Value GroupRepeatMode;
} // NS DTO
namespace Support {
using GroupRepeatMode = Jellyfin::DTO::GroupRepeatMode;
using GroupRepeatModeClass = Jellyfin::DTO::GroupRepeatModeClass;
template <>
GroupRepeatMode fromJsonValue<GroupRepeatMode>(const QJsonValue &source) {
if (!source.isString()) return GroupRepeatModeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("RepeatOne")) {
return GroupRepeatModeClass::RepeatOne;
}
if (str == QStringLiteral("RepeatAll")) {
return GroupRepeatModeClass::RepeatAll;
}
if (str == QStringLiteral("RepeatNone")) {
return GroupRepeatModeClass::RepeatNone;
}
return GroupRepeatModeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GROUPSHUFFLEMODE_H
#define JELLYFIN_DTO_GROUPSHUFFLEMODE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GroupShuffleModeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Sorted,
Shuffle,
};
@ -46,8 +51,31 @@ public:
private:
explicit GroupShuffleModeClass();
};
typedef GroupShuffleModeClass::Value GroupShuffleMode;
} // NS DTO
namespace Support {
using GroupShuffleMode = Jellyfin::DTO::GroupShuffleMode;
using GroupShuffleModeClass = Jellyfin::DTO::GroupShuffleModeClass;
template <>
GroupShuffleMode fromJsonValue<GroupShuffleMode>(const QJsonValue &source) {
if (!source.isString()) return GroupShuffleModeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Sorted")) {
return GroupShuffleModeClass::Sorted;
}
if (str == QStringLiteral("Shuffle")) {
return GroupShuffleModeClass::Shuffle;
}
return GroupShuffleModeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GROUPSTATETYPE_H
#define JELLYFIN_DTO_GROUPSTATETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GroupStateTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Idle,
Waiting,
Paused,
@ -48,8 +53,37 @@ public:
private:
explicit GroupStateTypeClass();
};
typedef GroupStateTypeClass::Value GroupStateType;
} // NS DTO
namespace Support {
using GroupStateType = Jellyfin::DTO::GroupStateType;
using GroupStateTypeClass = Jellyfin::DTO::GroupStateTypeClass;
template <>
GroupStateType fromJsonValue<GroupStateType>(const QJsonValue &source) {
if (!source.isString()) return GroupStateTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Idle")) {
return GroupStateTypeClass::Idle;
}
if (str == QStringLiteral("Waiting")) {
return GroupStateTypeClass::Waiting;
}
if (str == QStringLiteral("Paused")) {
return GroupStateTypeClass::Paused;
}
if (str == QStringLiteral("Playing")) {
return GroupStateTypeClass::Playing;
}
return GroupStateTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_GROUPUPDATETYPE_H
#define JELLYFIN_DTO_GROUPUPDATETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class GroupUpdateTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
UserJoined,
UserLeft,
GroupJoined,
@ -55,8 +60,58 @@ public:
private:
explicit GroupUpdateTypeClass();
};
typedef GroupUpdateTypeClass::Value GroupUpdateType;
} // NS DTO
namespace Support {
using GroupUpdateType = Jellyfin::DTO::GroupUpdateType;
using GroupUpdateTypeClass = Jellyfin::DTO::GroupUpdateTypeClass;
template <>
GroupUpdateType fromJsonValue<GroupUpdateType>(const QJsonValue &source) {
if (!source.isString()) return GroupUpdateTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("UserJoined")) {
return GroupUpdateTypeClass::UserJoined;
}
if (str == QStringLiteral("UserLeft")) {
return GroupUpdateTypeClass::UserLeft;
}
if (str == QStringLiteral("GroupJoined")) {
return GroupUpdateTypeClass::GroupJoined;
}
if (str == QStringLiteral("GroupLeft")) {
return GroupUpdateTypeClass::GroupLeft;
}
if (str == QStringLiteral("StateUpdate")) {
return GroupUpdateTypeClass::StateUpdate;
}
if (str == QStringLiteral("PlayQueue")) {
return GroupUpdateTypeClass::PlayQueue;
}
if (str == QStringLiteral("NotInGroup")) {
return GroupUpdateTypeClass::NotInGroup;
}
if (str == QStringLiteral("GroupDoesNotExist")) {
return GroupUpdateTypeClass::GroupDoesNotExist;
}
if (str == QStringLiteral("CreateGroupDenied")) {
return GroupUpdateTypeClass::CreateGroupDenied;
}
if (str == QStringLiteral("JoinGroupDenied")) {
return GroupUpdateTypeClass::JoinGroupDenied;
}
if (str == QStringLiteral("LibraryAccessDenied")) {
return GroupUpdateTypeClass::LibraryAccessDenied;
}
return GroupUpdateTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -32,42 +32,57 @@
#include <QDateTime>
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class GuideInfo : public QObject {
Q_OBJECT
public:
explicit GuideInfo(QObject *parent = nullptr);
static GuideInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class GuideInfo {
public:
explicit GuideInfo();
static GuideInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the start date.
*/
Q_PROPERTY(QDateTime startDate READ startDate WRITE setStartDate NOTIFY startDateChanged)
QDateTime startDate() const;
/**
* @brief Gets or sets the start date.
*/
void setStartDate(QDateTime newStartDate);
/**
* @brief Gets or sets the end date.
*/
Q_PROPERTY(QDateTime endDate READ endDate WRITE setEndDate NOTIFY endDateChanged)
QDateTime startDate() const;
void setStartDate(QDateTime newStartDate);
QDateTime endDate() const;
/**
* @brief Gets or sets the end date.
*/
void setEndDate(QDateTime newEndDate);
signals:
void startDateChanged(QDateTime newStartDate);
void endDateChanged(QDateTime newEndDate);
protected:
QDateTime m_startDate;
QDateTime m_endDate;
};
} // NS DTO
namespace Support {
using GuideInfo = Jellyfin::DTO::GuideInfo;
template <>
GuideInfo fromJsonValue<GuideInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return GuideInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_HEADERMATCHTYPE_H
#define JELLYFIN_DTO_HEADERMATCHTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class HeaderMatchTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Equals,
Regex,
Substring,
@ -47,8 +52,34 @@ public:
private:
explicit HeaderMatchTypeClass();
};
typedef HeaderMatchTypeClass::Value HeaderMatchType;
} // NS DTO
namespace Support {
using HeaderMatchType = Jellyfin::DTO::HeaderMatchType;
using HeaderMatchTypeClass = Jellyfin::DTO::HeaderMatchTypeClass;
template <>
HeaderMatchType fromJsonValue<HeaderMatchType>(const QJsonValue &source) {
if (!source.isString()) return HeaderMatchTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Equals")) {
return HeaderMatchTypeClass::Equals;
}
if (str == QStringLiteral("Regex")) {
return HeaderMatchTypeClass::Regex;
}
if (str == QStringLiteral("Substring")) {
return HeaderMatchTypeClass::Substring;
}
return HeaderMatchTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,45 +31,56 @@
#define JELLYFIN_DTO_HTTPHEADERINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/headermatchtype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class HttpHeaderInfo : public QObject {
Q_OBJECT
public:
explicit HttpHeaderInfo(QObject *parent = nullptr);
static HttpHeaderInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString value READ value WRITE setValue NOTIFY valueChanged)
Q_PROPERTY(HeaderMatchType match READ match WRITE setMatch NOTIFY matchChanged)
class HttpHeaderInfo {
public:
explicit HttpHeaderInfo();
static HttpHeaderInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
QString name() const;
void setName(QString newName);
QString value() const;
void setValue(QString newValue);
HeaderMatchType match() const;
void setMatch(HeaderMatchType newMatch);
signals:
void nameChanged(QString newName);
void valueChanged(QString newValue);
void matchChanged(HeaderMatchType newMatch);
protected:
QString m_name;
QString m_value;
HeaderMatchType m_match;
};
} // NS DTO
namespace Support {
using HttpHeaderInfo = Jellyfin::DTO::HttpHeaderInfo;
template <>
HttpHeaderInfo fromJsonValue<HttpHeaderInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return HttpHeaderInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,33 +31,48 @@
#define JELLYFIN_DTO_IGNOREWAITREQUESTDTO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class IgnoreWaitRequestDto : public QObject {
Q_OBJECT
public:
explicit IgnoreWaitRequestDto(QObject *parent = nullptr);
static IgnoreWaitRequestDto *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class IgnoreWaitRequestDto {
public:
explicit IgnoreWaitRequestDto();
static IgnoreWaitRequestDto fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets a value indicating whether the client should be ignored.
*/
Q_PROPERTY(bool ignoreWait READ ignoreWait WRITE setIgnoreWait NOTIFY ignoreWaitChanged)
bool ignoreWait() const;
/**
* @brief Gets or sets a value indicating whether the client should be ignored.
*/
void setIgnoreWait(bool newIgnoreWait);
signals:
void ignoreWaitChanged(bool newIgnoreWait);
protected:
bool m_ignoreWait;
};
} // NS DTO
namespace Support {
using IgnoreWaitRequestDto = Jellyfin::DTO::IgnoreWaitRequestDto;
template <>
IgnoreWaitRequestDto fromJsonValue<IgnoreWaitRequestDto>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return IgnoreWaitRequestDto::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,62 +31,65 @@
#define JELLYFIN_DTO_IMAGEBYNAMEINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ImageByNameInfo : public QObject {
Q_OBJECT
public:
explicit ImageByNameInfo(QObject *parent = nullptr);
static ImageByNameInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ImageByNameInfo {
public:
explicit ImageByNameInfo();
static ImageByNameInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
/**
* @brief Gets or sets the theme.
*/
Q_PROPERTY(QString theme READ theme WRITE setTheme NOTIFY themeChanged)
QString theme() const;
/**
* @brief Gets or sets the theme.
*/
void setTheme(QString newTheme);
/**
* @brief Gets or sets the context.
*/
Q_PROPERTY(QString context READ context WRITE setContext NOTIFY contextChanged)
QString context() const;
/**
* @brief Gets or sets the context.
*/
void setContext(QString newContext);
/**
* @brief Gets or sets the length of the file.
*/
Q_PROPERTY(qint64 fileLength READ fileLength WRITE setFileLength NOTIFY fileLengthChanged)
qint64 fileLength() const;
/**
* @brief Gets or sets the length of the file.
*/
void setFileLength(qint64 newFileLength);
/**
* @brief Gets or sets the format.
*/
Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged)
QString name() const;
void setName(QString newName);
QString theme() const;
void setTheme(QString newTheme);
QString context() const;
void setContext(QString newContext);
qint64 fileLength() const;
void setFileLength(qint64 newFileLength);
QString format() const;
/**
* @brief Gets or sets the format.
*/
void setFormat(QString newFormat);
signals:
void nameChanged(QString newName);
void themeChanged(QString newTheme);
void contextChanged(QString newContext);
void fileLengthChanged(qint64 newFileLength);
void formatChanged(QString newFormat);
protected:
QString m_name;
QString m_theme;
@ -95,6 +98,18 @@ protected:
QString m_format;
};
} // NS DTO
namespace Support {
using ImageByNameInfo = Jellyfin::DTO::ImageByNameInfo;
template <>
ImageByNameInfo fromJsonValue<ImageByNameInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ImageByNameInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_IMAGEFORMAT_H
#define JELLYFIN_DTO_IMAGEFORMAT_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ImageFormatClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Bmp,
Gif,
Jpg,
@ -49,8 +54,40 @@ public:
private:
explicit ImageFormatClass();
};
typedef ImageFormatClass::Value ImageFormat;
} // NS DTO
namespace Support {
using ImageFormat = Jellyfin::DTO::ImageFormat;
using ImageFormatClass = Jellyfin::DTO::ImageFormatClass;
template <>
ImageFormat fromJsonValue<ImageFormat>(const QJsonValue &source) {
if (!source.isString()) return ImageFormatClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Bmp")) {
return ImageFormatClass::Bmp;
}
if (str == QStringLiteral("Gif")) {
return ImageFormatClass::Gif;
}
if (str == QStringLiteral("Jpg")) {
return ImageFormatClass::Jpg;
}
if (str == QStringLiteral("Png")) {
return ImageFormatClass::Png;
}
if (str == QStringLiteral("Webp")) {
return ImageFormatClass::Webp;
}
return ImageFormatClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,85 +31,86 @@
#define JELLYFIN_DTO_IMAGEINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QString>
#include <optional>
#include "JellyfinQt/DTO/imagetype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ImageInfo : public QObject {
Q_OBJECT
public:
explicit ImageInfo(QObject *parent = nullptr);
static ImageInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(ImageType imageType READ imageType WRITE setImageType NOTIFY imageTypeChanged)
class ImageInfo {
public:
explicit ImageInfo();
static ImageInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
ImageType imageType() const;
void setImageType(ImageType newImageType);
/**
* @brief Gets or sets the index of the image.
*/
Q_PROPERTY(qint32 imageIndex READ imageIndex WRITE setImageIndex NOTIFY imageIndexChanged)
qint32 imageIndex() const;
/**
* @brief Gets or sets the index of the image.
*/
void setImageIndex(qint32 newImageIndex);
/**
* @brief Gets or sets the image tag.
*/
Q_PROPERTY(QString imageTag READ imageTag WRITE setImageTag NOTIFY imageTagChanged)
QString imageTag() const;
/**
* @brief Gets or sets the image tag.
*/
void setImageTag(QString newImageTag);
/**
* @brief Gets or sets the path.
*/
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
QString path() const;
/**
* @brief Gets or sets the path.
*/
void setPath(QString newPath);
/**
* @brief Gets or sets the blurhash.
*/
Q_PROPERTY(QString blurHash READ blurHash WRITE setBlurHash NOTIFY blurHashChanged)
QString blurHash() const;
/**
* @brief Gets or sets the blurhash.
*/
void setBlurHash(QString newBlurHash);
/**
* @brief Gets or sets the height.
*/
Q_PROPERTY(qint32 height READ height WRITE setHeight NOTIFY heightChanged)
qint32 height() const;
/**
* @brief Gets or sets the height.
*/
void setHeight(qint32 newHeight);
/**
* @brief Gets or sets the width.
*/
Q_PROPERTY(qint32 width READ width WRITE setWidth NOTIFY widthChanged)
qint32 width() const;
/**
* @brief Gets or sets the width.
*/
void setWidth(qint32 newWidth);
/**
* @brief Gets or sets the size.
*/
Q_PROPERTY(qint64 size READ size WRITE setSize NOTIFY sizeChanged)
ImageType imageType() const;
void setImageType(ImageType newImageType);
qint32 imageIndex() const;
void setImageIndex(qint32 newImageIndex);
QString imageTag() const;
void setImageTag(QString newImageTag);
QString path() const;
void setPath(QString newPath);
QString blurHash() const;
void setBlurHash(QString newBlurHash);
qint32 height() const;
void setHeight(qint32 newHeight);
qint32 width() const;
void setWidth(qint32 newWidth);
qint64 size() const;
/**
* @brief Gets or sets the size.
*/
void setSize(qint64 newSize);
signals:
void imageTypeChanged(ImageType newImageType);
void imageIndexChanged(qint32 newImageIndex);
void imageTagChanged(QString newImageTag);
void pathChanged(QString newPath);
void blurHashChanged(QString newBlurHash);
void heightChanged(qint32 newHeight);
void widthChanged(qint32 newWidth);
void sizeChanged(qint64 newSize);
protected:
ImageType m_imageType;
qint32 m_imageIndex;
@ -121,6 +122,18 @@ protected:
qint64 m_size;
};
} // NS DTO
namespace Support {
using ImageInfo = Jellyfin::DTO::ImageInfo;
template <>
ImageInfo fromJsonValue<ImageInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ImageInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,50 +31,63 @@
#define JELLYFIN_DTO_IMAGEOPTION_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <optional>
#include "JellyfinQt/DTO/imagetype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ImageOption : public QObject {
Q_OBJECT
public:
explicit ImageOption(QObject *parent = nullptr);
static ImageOption *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
Q_PROPERTY(ImageType type READ type WRITE setType NOTIFY typeChanged)
class ImageOption {
public:
explicit ImageOption();
static ImageOption fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
ImageType type() const;
void setType(ImageType newType);
/**
* @brief Gets or sets the limit.
*/
Q_PROPERTY(qint32 limit READ limit WRITE setLimit NOTIFY limitChanged)
qint32 limit() const;
/**
* @brief Gets or sets the limit.
*/
void setLimit(qint32 newLimit);
/**
* @brief Gets or sets the minimum width.
*/
Q_PROPERTY(qint32 minWidth READ minWidth WRITE setMinWidth NOTIFY minWidthChanged)
ImageType type() const;
void setType(ImageType newType);
qint32 limit() const;
void setLimit(qint32 newLimit);
qint32 minWidth() const;
/**
* @brief Gets or sets the minimum width.
*/
void setMinWidth(qint32 newMinWidth);
signals:
void typeChanged(ImageType newType);
void limitChanged(qint32 newLimit);
void minWidthChanged(qint32 newMinWidth);
protected:
ImageType m_type;
qint32 m_limit;
qint32 m_minWidth;
};
} // NS DTO
namespace Support {
using ImageOption = Jellyfin::DTO::ImageOption;
template <>
ImageOption fromJsonValue<ImageOption>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ImageOption::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_IMAGEORIENTATION_H
#define JELLYFIN_DTO_IMAGEORIENTATION_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ImageOrientationClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
TopLeft,
TopRight,
BottomRight,
@ -52,8 +57,49 @@ public:
private:
explicit ImageOrientationClass();
};
typedef ImageOrientationClass::Value ImageOrientation;
} // NS DTO
namespace Support {
using ImageOrientation = Jellyfin::DTO::ImageOrientation;
using ImageOrientationClass = Jellyfin::DTO::ImageOrientationClass;
template <>
ImageOrientation fromJsonValue<ImageOrientation>(const QJsonValue &source) {
if (!source.isString()) return ImageOrientationClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("TopLeft")) {
return ImageOrientationClass::TopLeft;
}
if (str == QStringLiteral("TopRight")) {
return ImageOrientationClass::TopRight;
}
if (str == QStringLiteral("BottomRight")) {
return ImageOrientationClass::BottomRight;
}
if (str == QStringLiteral("BottomLeft")) {
return ImageOrientationClass::BottomLeft;
}
if (str == QStringLiteral("LeftTop")) {
return ImageOrientationClass::LeftTop;
}
if (str == QStringLiteral("RightTop")) {
return ImageOrientationClass::RightTop;
}
if (str == QStringLiteral("RightBottom")) {
return ImageOrientationClass::RightBottom;
}
if (str == QStringLiteral("LeftBottom")) {
return ImageOrientationClass::LeftBottom;
}
return ImageOrientationClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,47 +31,61 @@
#define JELLYFIN_DTO_IMAGEPROVIDERINFO_H
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
#include <optional>
#include "JellyfinQt/DTO/imagetype.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ImageProviderInfo : public QObject {
Q_OBJECT
public:
explicit ImageProviderInfo(QObject *parent = nullptr);
static ImageProviderInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ImageProviderInfo {
public:
explicit ImageProviderInfo();
static ImageProviderInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets the name.
*/
void setName(QString newName);
/**
* @brief Gets the supported image types.
*/
Q_PROPERTY(QList<ImageType> supportedImages READ supportedImages WRITE setSupportedImages NOTIFY supportedImagesChanged)
QString name() const;
void setName(QString newName);
QList<ImageType> supportedImages() const;
/**
* @brief Gets the supported image types.
*/
void setSupportedImages(QList<ImageType> newSupportedImages);
signals:
void nameChanged(QString newName);
void supportedImagesChanged(QList<ImageType> newSupportedImages);
protected:
QString m_name;
QList<ImageType> m_supportedImages;
};
} // NS DTO
namespace Support {
using ImageProviderInfo = Jellyfin::DTO::ImageProviderInfo;
template <>
ImageProviderInfo fromJsonValue<ImageProviderInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ImageProviderInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_IMAGESAVINGCONVENTION_H
#define JELLYFIN_DTO_IMAGESAVINGCONVENTION_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ImageSavingConventionClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Legacy,
Compatible,
};
@ -46,8 +51,31 @@ public:
private:
explicit ImageSavingConventionClass();
};
typedef ImageSavingConventionClass::Value ImageSavingConvention;
} // NS DTO
namespace Support {
using ImageSavingConvention = Jellyfin::DTO::ImageSavingConvention;
using ImageSavingConventionClass = Jellyfin::DTO::ImageSavingConventionClass;
template <>
ImageSavingConvention fromJsonValue<ImageSavingConvention>(const QJsonValue &source) {
if (!source.isString()) return ImageSavingConventionClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Legacy")) {
return ImageSavingConventionClass::Legacy;
}
if (str == QStringLiteral("Compatible")) {
return ImageSavingConventionClass::Compatible;
}
return ImageSavingConventionClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_IMAGETYPE_H
#define JELLYFIN_DTO_IMAGETYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ImageTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Primary,
Art,
Backdrop,
@ -57,8 +62,64 @@ public:
private:
explicit ImageTypeClass();
};
typedef ImageTypeClass::Value ImageType;
} // NS DTO
namespace Support {
using ImageType = Jellyfin::DTO::ImageType;
using ImageTypeClass = Jellyfin::DTO::ImageTypeClass;
template <>
ImageType fromJsonValue<ImageType>(const QJsonValue &source) {
if (!source.isString()) return ImageTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Primary")) {
return ImageTypeClass::Primary;
}
if (str == QStringLiteral("Art")) {
return ImageTypeClass::Art;
}
if (str == QStringLiteral("Backdrop")) {
return ImageTypeClass::Backdrop;
}
if (str == QStringLiteral("Banner")) {
return ImageTypeClass::Banner;
}
if (str == QStringLiteral("Logo")) {
return ImageTypeClass::Logo;
}
if (str == QStringLiteral("Thumb")) {
return ImageTypeClass::Thumb;
}
if (str == QStringLiteral("Disc")) {
return ImageTypeClass::Disc;
}
if (str == QStringLiteral("Box")) {
return ImageTypeClass::Box;
}
if (str == QStringLiteral("Screenshot")) {
return ImageTypeClass::Screenshot;
}
if (str == QStringLiteral("Menu")) {
return ImageTypeClass::Menu;
}
if (str == QStringLiteral("Chapter")) {
return ImageTypeClass::Chapter;
}
if (str == QStringLiteral("BoxRear")) {
return ImageTypeClass::BoxRear;
}
if (str == QStringLiteral("Profile")) {
return ImageTypeClass::Profile;
}
return ImageTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,78 +31,93 @@
#define JELLYFIN_DTO_INSTALLATIONINFO_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/version.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class Version;
class InstallationInfo : public QObject {
Q_OBJECT
class InstallationInfo {
public:
explicit InstallationInfo(QObject *parent = nullptr);
static InstallationInfo *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit InstallationInfo();
static InstallationInfo fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the Id.
*/
Q_PROPERTY(QString guid READ guid WRITE setGuid NOTIFY guidChanged)
QUuid guid() const;
/**
* @brief Gets or sets the Id.
*/
void setGuid(QUuid newGuid);
/**
* @brief Gets or sets the name.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(Version * version READ version WRITE setVersion NOTIFY versionChanged)
QString name() const;
/**
* @brief Gets or sets the name.
*/
void setName(QString newName);
QSharedPointer<Version> version() const;
void setVersion(QSharedPointer<Version> newVersion);
/**
* @brief Gets or sets the changelog for this version.
*/
Q_PROPERTY(QString changelog READ changelog WRITE setChangelog NOTIFY changelogChanged)
QString changelog() const;
/**
* @brief Gets or sets the changelog for this version.
*/
void setChangelog(QString newChangelog);
/**
* @brief Gets or sets the source URL.
*/
Q_PROPERTY(QString sourceUrl READ sourceUrl WRITE setSourceUrl NOTIFY sourceUrlChanged)
QString sourceUrl() const;
/**
* @brief Gets or sets the source URL.
*/
void setSourceUrl(QString newSourceUrl);
/**
* @brief Gets or sets a checksum for the binary.
*/
Q_PROPERTY(QString checksum READ checksum WRITE setChecksum NOTIFY checksumChanged)
QString guid() const;
void setGuid(QString newGuid);
QString name() const;
void setName(QString newName);
Version * version() const;
void setVersion(Version * newVersion);
QString changelog() const;
void setChangelog(QString newChangelog);
QString sourceUrl() const;
void setSourceUrl(QString newSourceUrl);
QString checksum() const;
/**
* @brief Gets or sets a checksum for the binary.
*/
void setChecksum(QString newChecksum);
signals:
void guidChanged(QString newGuid);
void nameChanged(QString newName);
void versionChanged(Version * newVersion);
void changelogChanged(QString newChangelog);
void sourceUrlChanged(QString newSourceUrl);
void checksumChanged(QString newChecksum);
protected:
QString m_guid;
QUuid m_guid;
QString m_name;
Version * m_version = nullptr;
QSharedPointer<Version> m_version = nullptr;
QString m_changelog;
QString m_sourceUrl;
QString m_checksum;
};
} // NS DTO
namespace Support {
using InstallationInfo = Jellyfin::DTO::InstallationInfo;
template <>
InstallationInfo fromJsonValue<InstallationInfo>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return InstallationInfo::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -31,87 +31,102 @@
#define JELLYFIN_DTO_IPLUGIN_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <QSharedPointer>
#include <QString>
#include <QUuid>
#include <optional>
#include "JellyfinQt/DTO/version.h"
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class Version;
class IPlugin : public QObject {
Q_OBJECT
class IPlugin {
public:
explicit IPlugin(QObject *parent = nullptr);
static IPlugin *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
explicit IPlugin();
static IPlugin fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets the name of the plugin.
*/
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
QString name() const;
/**
* @brief Gets the name of the plugin.
*/
void setName(QString newName);
/**
* @brief Gets the Description.
*/
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged)
QString description() const;
/**
* @brief Gets the Description.
*/
void setDescription(QString newDescription);
/**
* @brief Gets the unique id.
*/
Q_PROPERTY(QString jellyfinId READ jellyfinId WRITE setJellyfinId NOTIFY jellyfinIdChanged)
Q_PROPERTY(Version * version READ version WRITE setVersion NOTIFY versionChanged)
QUuid jellyfinId() const;
/**
* @brief Gets the unique id.
*/
void setJellyfinId(QUuid newJellyfinId);
QSharedPointer<Version> version() const;
void setVersion(QSharedPointer<Version> newVersion);
/**
* @brief Gets the path to the assembly file.
*/
Q_PROPERTY(QString assemblyFilePath READ assemblyFilePath WRITE setAssemblyFilePath NOTIFY assemblyFilePathChanged)
QString assemblyFilePath() const;
/**
* @brief Gets the path to the assembly file.
*/
void setAssemblyFilePath(QString newAssemblyFilePath);
/**
* @brief Gets a value indicating whether the plugin can be uninstalled.
*/
Q_PROPERTY(bool canUninstall READ canUninstall WRITE setCanUninstall NOTIFY canUninstallChanged)
bool canUninstall() const;
/**
* @brief Gets a value indicating whether the plugin can be uninstalled.
*/
void setCanUninstall(bool newCanUninstall);
/**
* @brief Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.
*/
Q_PROPERTY(QString dataFolderPath READ dataFolderPath WRITE setDataFolderPath NOTIFY dataFolderPathChanged)
QString name() const;
void setName(QString newName);
QString description() const;
void setDescription(QString newDescription);
QString jellyfinId() const;
void setJellyfinId(QString newJellyfinId);
Version * version() const;
void setVersion(Version * newVersion);
QString assemblyFilePath() const;
void setAssemblyFilePath(QString newAssemblyFilePath);
bool canUninstall() const;
void setCanUninstall(bool newCanUninstall);
QString dataFolderPath() const;
/**
* @brief Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.
*/
void setDataFolderPath(QString newDataFolderPath);
signals:
void nameChanged(QString newName);
void descriptionChanged(QString newDescription);
void jellyfinIdChanged(QString newJellyfinId);
void versionChanged(Version * newVersion);
void assemblyFilePathChanged(QString newAssemblyFilePath);
void canUninstallChanged(bool newCanUninstall);
void dataFolderPathChanged(QString newDataFolderPath);
protected:
QString m_name;
QString m_description;
QString m_jellyfinId;
Version * m_version = nullptr;
QUuid m_jellyfinId;
QSharedPointer<Version> m_version = nullptr;
QString m_assemblyFilePath;
bool m_canUninstall;
QString m_dataFolderPath;
};
} // NS DTO
namespace Support {
using IPlugin = Jellyfin::DTO::IPlugin;
template <>
IPlugin fromJsonValue<IPlugin>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return IPlugin::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_ISOTYPE_H
#define JELLYFIN_DTO_ISOTYPE_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class IsoTypeClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
Dvd,
BluRay,
};
@ -46,8 +51,31 @@ public:
private:
explicit IsoTypeClass();
};
typedef IsoTypeClass::Value IsoType;
} // NS DTO
namespace Support {
using IsoType = Jellyfin::DTO::IsoType;
using IsoTypeClass = Jellyfin::DTO::IsoTypeClass;
template <>
IsoType fromJsonValue<IsoType>(const QJsonValue &source) {
if (!source.isString()) return IsoTypeClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("Dvd")) {
return IsoTypeClass::Dvd;
}
if (str == QStringLiteral("BluRay")) {
return IsoTypeClass::BluRay;
}
return IsoTypeClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,7 @@
#ifndef JELLYFIN_DTO_ITEM_H
#define JELLYFIN_DTO_ITEM_H
#include "JellyfinQt/DTO/baseitemdto.h"
#include "JellyfinQt/BaseItemDto"
namespace Jellyfin {
namespace DTO {

View file

@ -31,117 +31,120 @@
#define JELLYFIN_DTO_ITEMCOUNTS_H
#include <QJsonObject>
#include <QObject>
#include <QJsonValue>
#include <optional>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
class ItemCounts : public QObject {
Q_OBJECT
public:
explicit ItemCounts(QObject *parent = nullptr);
static ItemCounts *fromJSON(QJsonObject source, QObject *parent = nullptr);
void updateFromJSON(QJsonObject source);
QJsonObject toJSON();
class ItemCounts {
public:
explicit ItemCounts();
static ItemCounts fromJson(QJsonObject source);
void setFromJson(QJsonObject source);
QJsonObject toJson();
// Properties
/**
* @brief Gets or sets the movie count.
*/
Q_PROPERTY(qint32 movieCount READ movieCount WRITE setMovieCount NOTIFY movieCountChanged)
qint32 movieCount() const;
/**
* @brief Gets or sets the movie count.
*/
void setMovieCount(qint32 newMovieCount);
/**
* @brief Gets or sets the series count.
*/
Q_PROPERTY(qint32 seriesCount READ seriesCount WRITE setSeriesCount NOTIFY seriesCountChanged)
qint32 seriesCount() const;
/**
* @brief Gets or sets the series count.
*/
void setSeriesCount(qint32 newSeriesCount);
/**
* @brief Gets or sets the episode count.
*/
Q_PROPERTY(qint32 episodeCount READ episodeCount WRITE setEpisodeCount NOTIFY episodeCountChanged)
qint32 episodeCount() const;
/**
* @brief Gets or sets the episode count.
*/
void setEpisodeCount(qint32 newEpisodeCount);
/**
* @brief Gets or sets the artist count.
*/
Q_PROPERTY(qint32 artistCount READ artistCount WRITE setArtistCount NOTIFY artistCountChanged)
qint32 artistCount() const;
/**
* @brief Gets or sets the artist count.
*/
void setArtistCount(qint32 newArtistCount);
/**
* @brief Gets or sets the program count.
*/
Q_PROPERTY(qint32 programCount READ programCount WRITE setProgramCount NOTIFY programCountChanged)
qint32 programCount() const;
/**
* @brief Gets or sets the program count.
*/
void setProgramCount(qint32 newProgramCount);
/**
* @brief Gets or sets the trailer count.
*/
Q_PROPERTY(qint32 trailerCount READ trailerCount WRITE setTrailerCount NOTIFY trailerCountChanged)
qint32 trailerCount() const;
/**
* @brief Gets or sets the trailer count.
*/
void setTrailerCount(qint32 newTrailerCount);
/**
* @brief Gets or sets the song count.
*/
Q_PROPERTY(qint32 songCount READ songCount WRITE setSongCount NOTIFY songCountChanged)
qint32 songCount() const;
/**
* @brief Gets or sets the song count.
*/
void setSongCount(qint32 newSongCount);
/**
* @brief Gets or sets the album count.
*/
Q_PROPERTY(qint32 albumCount READ albumCount WRITE setAlbumCount NOTIFY albumCountChanged)
qint32 albumCount() const;
/**
* @brief Gets or sets the album count.
*/
void setAlbumCount(qint32 newAlbumCount);
/**
* @brief Gets or sets the music video count.
*/
Q_PROPERTY(qint32 musicVideoCount READ musicVideoCount WRITE setMusicVideoCount NOTIFY musicVideoCountChanged)
qint32 musicVideoCount() const;
/**
* @brief Gets or sets the music video count.
*/
void setMusicVideoCount(qint32 newMusicVideoCount);
/**
* @brief Gets or sets the box set count.
*/
Q_PROPERTY(qint32 boxSetCount READ boxSetCount WRITE setBoxSetCount NOTIFY boxSetCountChanged)
qint32 boxSetCount() const;
/**
* @brief Gets or sets the box set count.
*/
void setBoxSetCount(qint32 newBoxSetCount);
/**
* @brief Gets or sets the book count.
*/
Q_PROPERTY(qint32 bookCount READ bookCount WRITE setBookCount NOTIFY bookCountChanged)
qint32 bookCount() const;
/**
* @brief Gets or sets the book count.
*/
void setBookCount(qint32 newBookCount);
/**
* @brief Gets or sets the item count.
*/
Q_PROPERTY(qint32 itemCount READ itemCount WRITE setItemCount NOTIFY itemCountChanged)
qint32 movieCount() const;
void setMovieCount(qint32 newMovieCount);
qint32 seriesCount() const;
void setSeriesCount(qint32 newSeriesCount);
qint32 episodeCount() const;
void setEpisodeCount(qint32 newEpisodeCount);
qint32 artistCount() const;
void setArtistCount(qint32 newArtistCount);
qint32 programCount() const;
void setProgramCount(qint32 newProgramCount);
qint32 trailerCount() const;
void setTrailerCount(qint32 newTrailerCount);
qint32 songCount() const;
void setSongCount(qint32 newSongCount);
qint32 albumCount() const;
void setAlbumCount(qint32 newAlbumCount);
qint32 musicVideoCount() const;
void setMusicVideoCount(qint32 newMusicVideoCount);
qint32 boxSetCount() const;
void setBoxSetCount(qint32 newBoxSetCount);
qint32 bookCount() const;
void setBookCount(qint32 newBookCount);
qint32 itemCount() const;
/**
* @brief Gets or sets the item count.
*/
void setItemCount(qint32 newItemCount);
signals:
void movieCountChanged(qint32 newMovieCount);
void seriesCountChanged(qint32 newSeriesCount);
void episodeCountChanged(qint32 newEpisodeCount);
void artistCountChanged(qint32 newArtistCount);
void programCountChanged(qint32 newProgramCount);
void trailerCountChanged(qint32 newTrailerCount);
void songCountChanged(qint32 newSongCount);
void albumCountChanged(qint32 newAlbumCount);
void musicVideoCountChanged(qint32 newMusicVideoCount);
void boxSetCountChanged(qint32 newBoxSetCount);
void bookCountChanged(qint32 newBookCount);
void itemCountChanged(qint32 newItemCount);
protected:
qint32 m_movieCount;
qint32 m_seriesCount;
@ -157,6 +160,18 @@ protected:
qint32 m_itemCount;
};
} // NS DTO
namespace Support {
using ItemCounts = Jellyfin::DTO::ItemCounts;
template <>
ItemCounts fromJsonValue<ItemCounts>(const QJsonValue &source) {
if (!source.isObject()) throw new ParseException("Expected JSON Object");
return ItemCounts::fromJson(source.toObject());
}
} // NS Jellyfin
} // NS DTO

View file

@ -30,7 +30,11 @@
#ifndef JELLYFIN_DTO_ITEMFIELDS_H
#define JELLYFIN_DTO_ITEMFIELDS_H
#include <QJsonValue>
#include <QObject>
#include <QString>
#include "JellyfinQt/support/jsonconv.h"
namespace Jellyfin {
namespace DTO {
@ -39,6 +43,7 @@ class ItemFieldsClass {
Q_GADGET
public:
enum Value {
EnumNotSet,
AirTime,
CanDelete,
CanDownload,
@ -105,8 +110,208 @@ public:
private:
explicit ItemFieldsClass();
};
typedef ItemFieldsClass::Value ItemFields;
} // NS DTO
namespace Support {
using ItemFields = Jellyfin::DTO::ItemFields;
using ItemFieldsClass = Jellyfin::DTO::ItemFieldsClass;
template <>
ItemFields fromJsonValue<ItemFields>(const QJsonValue &source) {
if (!source.isString()) return ItemFieldsClass::EnumNotSet;
QString str = source.toString();
if (str == QStringLiteral("AirTime")) {
return ItemFieldsClass::AirTime;
}
if (str == QStringLiteral("CanDelete")) {
return ItemFieldsClass::CanDelete;
}
if (str == QStringLiteral("CanDownload")) {
return ItemFieldsClass::CanDownload;
}
if (str == QStringLiteral("ChannelInfo")) {
return ItemFieldsClass::ChannelInfo;
}
if (str == QStringLiteral("Chapters")) {
return ItemFieldsClass::Chapters;
}
if (str == QStringLiteral("ChildCount")) {
return ItemFieldsClass::ChildCount;
}
if (str == QStringLiteral("CumulativeRunTimeTicks")) {
return ItemFieldsClass::CumulativeRunTimeTicks;
}
if (str == QStringLiteral("CustomRating")) {
return ItemFieldsClass::CustomRating;
}
if (str == QStringLiteral("DateCreated")) {
return ItemFieldsClass::DateCreated;
}
if (str == QStringLiteral("DateLastMediaAdded")) {
return ItemFieldsClass::DateLastMediaAdded;
}
if (str == QStringLiteral("DisplayPreferencesId")) {
return ItemFieldsClass::DisplayPreferencesId;
}
if (str == QStringLiteral("Etag")) {
return ItemFieldsClass::Etag;
}
if (str == QStringLiteral("ExternalUrls")) {
return ItemFieldsClass::ExternalUrls;
}
if (str == QStringLiteral("Genres")) {
return ItemFieldsClass::Genres;
}
if (str == QStringLiteral("HomePageUrl")) {
return ItemFieldsClass::HomePageUrl;
}
if (str == QStringLiteral("ItemCounts")) {
return ItemFieldsClass::ItemCounts;
}
if (str == QStringLiteral("MediaSourceCount")) {
return ItemFieldsClass::MediaSourceCount;
}
if (str == QStringLiteral("MediaSources")) {
return ItemFieldsClass::MediaSources;
}
if (str == QStringLiteral("OriginalTitle")) {
return ItemFieldsClass::OriginalTitle;
}
if (str == QStringLiteral("Overview")) {
return ItemFieldsClass::Overview;
}
if (str == QStringLiteral("ParentId")) {
return ItemFieldsClass::ParentId;
}
if (str == QStringLiteral("Path")) {
return ItemFieldsClass::Path;
}
if (str == QStringLiteral("People")) {
return ItemFieldsClass::People;
}
if (str == QStringLiteral("PlayAccess")) {
return ItemFieldsClass::PlayAccess;
}
if (str == QStringLiteral("ProductionLocations")) {
return ItemFieldsClass::ProductionLocations;
}
if (str == QStringLiteral("ProviderIds")) {
return ItemFieldsClass::ProviderIds;
}
if (str == QStringLiteral("PrimaryImageAspectRatio")) {
return ItemFieldsClass::PrimaryImageAspectRatio;
}
if (str == QStringLiteral("RecursiveItemCount")) {
return ItemFieldsClass::RecursiveItemCount;
}
if (str == QStringLiteral("Settings")) {
return ItemFieldsClass::Settings;
}
if (str == QStringLiteral("ScreenshotImageTags")) {
return ItemFieldsClass::ScreenshotImageTags;
}
if (str == QStringLiteral("SeriesPrimaryImage")) {
return ItemFieldsClass::SeriesPrimaryImage;
}
if (str == QStringLiteral("SeriesStudio")) {
return ItemFieldsClass::SeriesStudio;
}
if (str == QStringLiteral("SortName")) {
return ItemFieldsClass::SortName;
}
if (str == QStringLiteral("SpecialEpisodeNumbers")) {
return ItemFieldsClass::SpecialEpisodeNumbers;
}
if (str == QStringLiteral("Studios")) {
return ItemFieldsClass::Studios;
}
if (str == QStringLiteral("BasicSyncInfo")) {
return ItemFieldsClass::BasicSyncInfo;
}
if (str == QStringLiteral("SyncInfo")) {
return ItemFieldsClass::SyncInfo;
}
if (str == QStringLiteral("Taglines")) {
return ItemFieldsClass::Taglines;
}
if (str == QStringLiteral("Tags")) {
return ItemFieldsClass::Tags;
}
if (str == QStringLiteral("RemoteTrailers")) {
return ItemFieldsClass::RemoteTrailers;
}
if (str == QStringLiteral("MediaStreams")) {
return ItemFieldsClass::MediaStreams;
}
if (str == QStringLiteral("SeasonUserData")) {
return ItemFieldsClass::SeasonUserData;
}
if (str == QStringLiteral("ServiceName")) {
return ItemFieldsClass::ServiceName;
}
if (str == QStringLiteral("ThemeSongIds")) {
return ItemFieldsClass::ThemeSongIds;
}
if (str == QStringLiteral("ThemeVideoIds")) {
return ItemFieldsClass::ThemeVideoIds;
}
if (str == QStringLiteral("ExternalEtag")) {
return ItemFieldsClass::ExternalEtag;
}
if (str == QStringLiteral("PresentationUniqueKey")) {
return ItemFieldsClass::PresentationUniqueKey;
}
if (str == QStringLiteral("InheritedParentalRatingValue")) {
return ItemFieldsClass::InheritedParentalRatingValue;
}
if (str == QStringLiteral("ExternalSeriesId")) {
return ItemFieldsClass::ExternalSeriesId;
}
if (str == QStringLiteral("SeriesPresentationUniqueKey")) {
return ItemFieldsClass::SeriesPresentationUniqueKey;
}
if (str == QStringLiteral("DateLastRefreshed")) {
return ItemFieldsClass::DateLastRefreshed;
}
if (str == QStringLiteral("DateLastSaved")) {
return ItemFieldsClass::DateLastSaved;
}
if (str == QStringLiteral("RefreshState")) {
return ItemFieldsClass::RefreshState;
}
if (str == QStringLiteral("ChannelImage")) {
return ItemFieldsClass::ChannelImage;
}
if (str == QStringLiteral("EnableMediaSourceDisplay")) {
return ItemFieldsClass::EnableMediaSourceDisplay;
}
if (str == QStringLiteral("Width")) {
return ItemFieldsClass::Width;
}
if (str == QStringLiteral("Height")) {
return ItemFieldsClass::Height;
}
if (str == QStringLiteral("ExtraIds")) {
return ItemFieldsClass::ExtraIds;
}
if (str == QStringLiteral("LocalTrailerCount")) {
return ItemFieldsClass::LocalTrailerCount;
}
if (str == QStringLiteral("IsHD")) {
return ItemFieldsClass::IsHD;
}
if (str == QStringLiteral("SpecialFeatureCount")) {
return ItemFieldsClass::SpecialFeatureCount;
}
return ItemFieldsClass::EnumNotSet;
}
} // NS Jellyfin
} // NS DTO

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