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 path() const;
87 void setPath(QString newPath);
88 bool pathNull() const;
89 void setPathNull();
90
94 QString metadataLanguage() const;
98 void setMetadataLanguage(QString newMetadataLanguage);
99 bool metadataLanguageNull() const;
101
105 QString metadataCountryCode() const;
109 void setMetadataCountryCode(QString newMetadataCountryCode);
110 bool metadataCountryCodeNull() const;
112
116 QJsonObject providerIds() const;
120 void setProviderIds(QJsonObject newProviderIds);
121 bool providerIdsNull() const;
122 void setProviderIdsNull();
123
127 std::optional<qint32> year() const;
131 void setYear(std::optional<qint32> newYear);
132 bool yearNull() const;
133 void setYearNull();
134
135
136 std::optional<qint32> indexNumber() const;
137
138 void setIndexNumber(std::optional<qint32> newIndexNumber);
139 bool indexNumberNull() const;
140 void setIndexNumberNull();
141
142
143 std::optional<qint32> parentIndexNumber() const;
144
145 void setParentIndexNumber(std::optional<qint32> newParentIndexNumber);
146 bool parentIndexNumberNull() const;
148
149
150 QDateTime premiereDate() const;
151
152 void setPremiereDate(QDateTime newPremiereDate);
153 bool premiereDateNull() const;
154 void setPremiereDateNull();
155
156
157 bool isAutomated() const;
158
159 void setIsAutomated(bool newIsAutomated);
160
161
162 QStringList albumArtists() const;
163
164 void setAlbumArtists(QStringList newAlbumArtists);
165 bool albumArtistsNull() const;
166 void setAlbumArtistsNull();
167
168
169 QString album() const;
170
171 void setAlbum(QString newAlbum);
172 bool albumNull() const;
173 void setAlbumNull();
174
175
176 QStringList artists() const;
177
178 void setArtists(QStringList newArtists);
179 bool artistsNull() const;
180 void setArtistsNull();
181
182
183protected:
184 QString m_name;
185 QString m_path;
188 QJsonObject m_providerIds;
189 std::optional<qint32> m_year = std::nullopt;
190 std::optional<qint32> m_indexNumber = std::nullopt;
191 std::optional<qint32> m_parentIndexNumber = std::nullopt;
192 QDateTime m_premiereDate;
194 QStringList m_albumArtists;
195 QString m_album;
196 QStringList m_artists;
197
198private:
199 // Private constructor which generates an invalid object, for use withing SongInfo::fromJson();
200 SongInfo();
201};
202
203
204} // NS DTO
205
206namespace Support {
207
209
210template <>
211SongInfo fromJsonValue(const QJsonValue &source, convertType<SongInfo>);
212
213template<>
214QJsonValue toJsonValue(const SongInfo &source, convertType<SongInfo>);
215
216} // NS DTO
217} // NS Jellyfin
218
219#endif // JELLYFIN_DTO_SONGINFO_H
Definition songinfo.h:51
bool metadataLanguageNull() const
Definition songinfo.cpp:198
QString m_path
Definition songinfo.h:185
void setParentIndexNumber(std::optional< qint32 > newParentIndexNumber)
Definition songinfo.cpp:260
bool parentIndexNumberNull() const
Definition songinfo.cpp:263
bool artistsNull() const
Definition songinfo.cpp:321
static SongInfo fromJson(QJsonObject source)
Definition songinfo.cpp:76
void setProviderIdsNull()
Definition songinfo.cpp:228
std::optional< qint32 > m_parentIndexNumber
Definition songinfo.h:191
void setMetadataCountryCode(QString newMetadataCountryCode)
Gets or sets the metadata country code.
Definition songinfo.cpp:208
std::optional< qint32 > year() const
Gets or sets the year.
Definition songinfo.cpp:232
QString m_album
Definition songinfo.h:195
QJsonObject providerIds() const
Gets or sets the provider ids.
Definition songinfo.cpp:219
QJsonObject toJson() const
Definition songinfo.cpp:100
QString album() const
Definition songinfo.cpp:303
bool yearNull() const
Definition songinfo.cpp:237
bool nameNull() const
Definition songinfo.cpp:172
bool isAutomated() const
Definition songinfo.cpp:284
QDateTime m_premiereDate
Definition songinfo.h:192
bool m_isAutomated
Definition songinfo.h:193
void setAlbum(QString newAlbum)
Definition songinfo.cpp:305
void setName(QString newName)
Gets or sets the name.
Definition songinfo.cpp:169
QString name() const
Gets or sets the name.
Definition songinfo.cpp:167
void setAlbumNull()
Definition songinfo.cpp:312
void setMetadataLanguage(QString newMetadataLanguage)
Gets or sets the metadata language.
Definition songinfo.cpp:195
void setYear(std::optional< qint32 > newYear)
Gets or sets the year.
Definition songinfo.cpp:234
void setArtistsNull()
Definition songinfo.cpp:325
bool indexNumberNull() const
Definition songinfo.cpp:250
void setArtists(QStringList newArtists)
Definition songinfo.cpp:318
QString metadataLanguage() const
Gets or sets the metadata language.
Definition songinfo.cpp:193
QStringList m_artists
Definition songinfo.h:196
QStringList albumArtists() const
Definition songinfo.cpp:290
QString path() const
Gets or sets the path.
Definition songinfo.cpp:180
void setPremiereDateNull()
Definition songinfo.cpp:280
void setYearNull()
Definition songinfo.cpp:241
void setMetadataLanguageNull()
Definition songinfo.cpp:202
void setNameNull()
Definition songinfo.cpp:176
bool albumArtistsNull() const
Definition songinfo.cpp:295
std::optional< qint32 > m_year
Definition songinfo.h:189
bool premiereDateNull() const
Definition songinfo.cpp:276
void setFromJson(QJsonObject source)
Definition songinfo.cpp:83
void setPremiereDate(QDateTime newPremiereDate)
Definition songinfo.cpp:273
void setMetadataCountryCodeNull()
Definition songinfo.cpp:215
std::optional< qint32 > m_indexNumber
Definition songinfo.h:190
QJsonObject m_providerIds
Definition songinfo.h:188
bool albumNull() const
Definition songinfo.cpp:308
QStringList m_albumArtists
Definition songinfo.h:194
bool metadataCountryCodeNull() const
Definition songinfo.cpp:211
QString metadataCountryCode() const
Gets or sets the metadata country code.
Definition songinfo.cpp:206
void setIndexNumber(std::optional< qint32 > newIndexNumber)
Definition songinfo.cpp:247
QString m_metadataLanguage
Definition songinfo.h:186
void setAlbumArtists(QStringList newAlbumArtists)
Definition songinfo.cpp:292
void setIsAutomated(bool newIsAutomated)
Definition songinfo.cpp:286
QString m_name
Definition songinfo.h:184
void setIndexNumberNull()
Definition songinfo.cpp:254
bool pathNull() const
Definition songinfo.cpp:185
bool providerIdsNull() const
Definition songinfo.cpp:224
QDateTime premiereDate() const
Definition songinfo.cpp:271
QString m_metadataCountryCode
Definition songinfo.h:187
void setParentIndexNumberNull()
Definition songinfo.cpp:267
std::optional< qint32 > parentIndexNumber() const
Definition songinfo.cpp:258
void setAlbumArtistsNull()
Definition songinfo.cpp:299
std::optional< qint32 > indexNumber() const
Definition songinfo.cpp:245
QStringList artists() const
Definition songinfo.cpp:316
void replaceData(SongInfo &other)
Definition songinfo.cpp:60
void setProviderIds(QJsonObject newProviderIds)
Gets or sets the provider ids.
Definition songinfo.cpp:221
void setPath(QString newPath)
Gets or sets the path.
Definition songinfo.cpp:182
void setPathNull()
Definition songinfo.cpp:189
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