Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
songinfo.h
Go to the documentation of this file.
1/*
2 * Sailfin: a Jellyfin client written using Qt
3 * Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19/*
20 * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
21 * OVERWRITTEN AT SOME POINT!
22 *
23 * If there is a bug in this file, please fix the code generator used to generate this file found in
24 * core/openapigenerator.d.
25 *
26 * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
27 * file with a newer file if needed instead of manually updating the files.
28 */
29
30#ifndef JELLYFIN_DTO_SONGINFO_H
31#define JELLYFIN_DTO_SONGINFO_H
32
33#include <QDateTime>
34#include <QJsonObject>
35#include <QJsonValue>
36#include <QList>
37#include <QString>
38#include <QStringList>
39#include <optional>
40
42
43namespace Jellyfin {
44// Forward declaration
45class ApiClient;
46}
47namespace Jellyfin {
48namespace DTO {
49
50
51class SongInfo {
52public:
53 SongInfo(
54 bool isAutomated
55 );
56
57 SongInfo(const SongInfo &other);
58
62 void replaceData(SongInfo &other);
63
64 static SongInfo fromJson(QJsonObject source);
65 void setFromJson(QJsonObject source);
66 QJsonObject toJson() const;
67
68 // Properties
72 QString name() const;
76 void setName(QString newName);
77 bool nameNull() const;
78 void setNameNull();
79
83 QString originalTitle() const;
87 void setOriginalTitle(QString newOriginalTitle);
88 bool originalTitleNull() const;
90
94 QString path() const;
98 void setPath(QString newPath);
99 bool pathNull() const;
100 void setPathNull();
101
105 QString metadataLanguage() const;
109 void setMetadataLanguage(QString newMetadataLanguage);
110 bool metadataLanguageNull() const;
112
116 QString metadataCountryCode() const;
120 void setMetadataCountryCode(QString newMetadataCountryCode);
121 bool metadataCountryCodeNull() const;
123
127 QJsonObject providerIds() const;
131 void setProviderIds(QJsonObject newProviderIds);
132 bool providerIdsNull() const;
133 void setProviderIdsNull();
134
138 std::optional<qint32> year() const;
142 void setYear(std::optional<qint32> newYear);
143 bool yearNull() const;
144 void setYearNull();
145
146
147 std::optional<qint32> indexNumber() const;
148
149 void setIndexNumber(std::optional<qint32> newIndexNumber);
150 bool indexNumberNull() const;
151 void setIndexNumberNull();
152
153
154 std::optional<qint32> parentIndexNumber() const;
155
156 void setParentIndexNumber(std::optional<qint32> newParentIndexNumber);
157 bool parentIndexNumberNull() const;
159
160
161 QDateTime premiereDate() const;
162
163 void setPremiereDate(QDateTime newPremiereDate);
164 bool premiereDateNull() const;
165 void setPremiereDateNull();
166
167
168 bool isAutomated() const;
169
170 void setIsAutomated(bool newIsAutomated);
171
172
173 QStringList albumArtists() const;
174
175 void setAlbumArtists(QStringList newAlbumArtists);
176 bool albumArtistsNull() const;
177 void setAlbumArtistsNull();
178
179
180 QString album() const;
181
182 void setAlbum(QString newAlbum);
183 bool albumNull() const;
184 void setAlbumNull();
185
186
187 QStringList artists() const;
188
189 void setArtists(QStringList newArtists);
190 bool artistsNull() const;
191 void setArtistsNull();
192
193
194protected:
195 QString m_name;
197 QString m_path;
200 QJsonObject m_providerIds;
201 std::optional<qint32> m_year = std::nullopt;
202 std::optional<qint32> m_indexNumber = std::nullopt;
203 std::optional<qint32> m_parentIndexNumber = std::nullopt;
204 QDateTime m_premiereDate;
206 QStringList m_albumArtists;
207 QString m_album;
208 QStringList m_artists;
209
210private:
211 // Private constructor which generates an invalid object, for use withing SongInfo::fromJson();
212 SongInfo();
213};
214
215
216} // NS DTO
217
218namespace Support {
219
221
222template <>
223SongInfo fromJsonValue(const QJsonValue &source, convertType<SongInfo>);
224
225template<>
226QJsonValue toJsonValue(const SongInfo &source, convertType<SongInfo>);
227
228} // NS DTO
229} // NS Jellyfin
230
231#endif // JELLYFIN_DTO_SONGINFO_H
An Api client for Jellyfin. Handles requests and authentication.
Definition apiclient.h:90
Definition songinfo.h:51
bool metadataLanguageNull() const
Definition songinfo.cpp:219
QString m_path
Definition songinfo.h:197
void setParentIndexNumber(std::optional< qint32 > newParentIndexNumber)
Definition songinfo.cpp:281
bool parentIndexNumberNull() const
Definition songinfo.cpp:284
bool artistsNull() const
Definition songinfo.cpp:342
static SongInfo fromJson(QJsonObject source)
Definition songinfo.cpp:78
void setProviderIdsNull()
Definition songinfo.cpp:249
std::optional< qint32 > m_parentIndexNumber
Definition songinfo.h:203
bool originalTitleNull() const
Definition songinfo.cpp:193
void setMetadataCountryCode(QString newMetadataCountryCode)
Gets or sets the metadata country code.
Definition songinfo.cpp:229
std::optional< qint32 > year() const
Gets or sets the year.
Definition songinfo.cpp:253
QString m_album
Definition songinfo.h:207
QJsonObject providerIds() const
Gets or sets the provider ids.
Definition songinfo.cpp:240
QJsonObject toJson() const
Definition songinfo.cpp:103
QString album() const
Definition songinfo.cpp:324
bool yearNull() const
Definition songinfo.cpp:258
bool nameNull() const
Definition songinfo.cpp:180
bool isAutomated() const
Definition songinfo.cpp:305
QDateTime m_premiereDate
Definition songinfo.h:204
bool m_isAutomated
Definition songinfo.h:205
void setAlbum(QString newAlbum)
Definition songinfo.cpp:326
void setName(QString newName)
Gets or sets the name.
Definition songinfo.cpp:177
QString name() const
Gets or sets the name.
Definition songinfo.cpp:175
void setAlbumNull()
Definition songinfo.cpp:333
void setMetadataLanguage(QString newMetadataLanguage)
Gets or sets the metadata language.
Definition songinfo.cpp:216
void setYear(std::optional< qint32 > newYear)
Gets or sets the year.
Definition songinfo.cpp:255
void setArtistsNull()
Definition songinfo.cpp:346
bool indexNumberNull() const
Definition songinfo.cpp:271
void setArtists(QStringList newArtists)
Definition songinfo.cpp:339
QString metadataLanguage() const
Gets or sets the metadata language.
Definition songinfo.cpp:214
QStringList m_artists
Definition songinfo.h:208
QStringList albumArtists() const
Definition songinfo.cpp:311
QString path() const
Gets or sets the path.
Definition songinfo.cpp:201
void setPremiereDateNull()
Definition songinfo.cpp:301
void setYearNull()
Definition songinfo.cpp:262
void setMetadataLanguageNull()
Definition songinfo.cpp:223
void setNameNull()
Definition songinfo.cpp:184
bool albumArtistsNull() const
Definition songinfo.cpp:316
std::optional< qint32 > m_year
Definition songinfo.h:201
bool premiereDateNull() const
Definition songinfo.cpp:297
void setFromJson(QJsonObject source)
Definition songinfo.cpp:85
void setPremiereDate(QDateTime newPremiereDate)
Definition songinfo.cpp:294
void setMetadataCountryCodeNull()
Definition songinfo.cpp:236
QString originalTitle() const
Gets or sets the original title.
Definition songinfo.cpp:188
std::optional< qint32 > m_indexNumber
Definition songinfo.h:202
SongInfo(bool isAutomated)
Definition songinfo.cpp:36
QJsonObject m_providerIds
Definition songinfo.h:200
void setOriginalTitleNull()
Definition songinfo.cpp:197
bool albumNull() const
Definition songinfo.cpp:329
QStringList m_albumArtists
Definition songinfo.h:206
bool metadataCountryCodeNull() const
Definition songinfo.cpp:232
QString metadataCountryCode() const
Gets or sets the metadata country code.
Definition songinfo.cpp:227
void setIndexNumber(std::optional< qint32 > newIndexNumber)
Definition songinfo.cpp:268
QString m_metadataLanguage
Definition songinfo.h:198
void setAlbumArtists(QStringList newAlbumArtists)
Definition songinfo.cpp:313
void setIsAutomated(bool newIsAutomated)
Definition songinfo.cpp:307
QString m_name
Definition songinfo.h:195
void setOriginalTitle(QString newOriginalTitle)
Gets or sets the original title.
Definition songinfo.cpp:190
void setIndexNumberNull()
Definition songinfo.cpp:275
bool pathNull() const
Definition songinfo.cpp:206
bool providerIdsNull() const
Definition songinfo.cpp:245
QDateTime premiereDate() const
Definition songinfo.cpp:292
QString m_metadataCountryCode
Definition songinfo.h:199
void setParentIndexNumberNull()
Definition songinfo.cpp:288
std::optional< qint32 > parentIndexNumber() const
Definition songinfo.cpp:279
void setAlbumArtistsNull()
Definition songinfo.cpp:320
std::optional< qint32 > indexNumber() const
Definition songinfo.cpp:266
QString m_originalTitle
Definition songinfo.h:196
QStringList artists() const
Definition songinfo.cpp:337
void replaceData(SongInfo &other)
Definition songinfo.cpp:61
void setProviderIds(QJsonObject newProviderIds)
Gets or sets the provider ids.
Definition songinfo.cpp:242
void setPath(QString newPath)
Gets or sets the path.
Definition songinfo.cpp:203
void setPathNull()
Definition songinfo.cpp:210
Contains auto-generated Data Transfer Objects for the Jellyfin HTTP API.
Definition accessschedule.h:128
Jellyfin::DTO::SongInfo SongInfo
Definition songinfo.h:220
AccessSchedule fromJsonValue(const QJsonValue &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:133
QJsonValue toJsonValue(const AccessSchedule &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:139
Definition jsonconvimpl.h:45