mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-06 02:32:44 +00:00
Make model code compileable
This disables some application level logic, but I'm going to rewrite that using Lager anyway.
This commit is contained in:
parent
0358418926
commit
b9b08ab384
551 changed files with 8943 additions and 8809 deletions
|
@ -32,28 +32,29 @@
|
|||
namespace Jellyfin {
|
||||
namespace DTO {
|
||||
|
||||
BufferRequestDto::BufferRequestDto(QObject *parent) {}
|
||||
BufferRequestDto::BufferRequestDto() {}
|
||||
|
||||
BufferRequestDto BufferRequestDto::fromJson(QJsonObject source) {BufferRequestDto instance;
|
||||
instance->setFromJson(source, false);
|
||||
BufferRequestDto BufferRequestDto::fromJson(QJsonObject source) {
|
||||
BufferRequestDto instance;
|
||||
instance.setFromJson(source);
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
void BufferRequestDto::setFromJson(QJsonObject source) {
|
||||
m_when = fromJsonValue<QDateTime>(source["When"]);
|
||||
m_positionTicks = fromJsonValue<qint64>(source["PositionTicks"]);
|
||||
m_isPlaying = fromJsonValue<bool>(source["IsPlaying"]);
|
||||
m_playlistItemId = fromJsonValue<QUuid>(source["PlaylistItemId"]);
|
||||
m_when = Jellyfin::Support::fromJsonValue<QDateTime>(source["When"]);
|
||||
m_positionTicks = Jellyfin::Support::fromJsonValue<qint64>(source["PositionTicks"]);
|
||||
m_isPlaying = Jellyfin::Support::fromJsonValue<bool>(source["IsPlaying"]);
|
||||
m_playlistItemId = Jellyfin::Support::fromJsonValue<QUuid>(source["PlaylistItemId"]);
|
||||
|
||||
}
|
||||
|
||||
QJsonObject BufferRequestDto::toJson() {
|
||||
QJsonObject result;
|
||||
result["When"] = toJsonValue<QDateTime>(m_when);
|
||||
result["PositionTicks"] = toJsonValue<qint64>(m_positionTicks);
|
||||
result["IsPlaying"] = toJsonValue<bool>(m_isPlaying);
|
||||
result["PlaylistItemId"] = toJsonValue<QUuid>(m_playlistItemId);
|
||||
result["When"] = Jellyfin::Support::toJsonValue<QDateTime>(m_when);
|
||||
result["PositionTicks"] = Jellyfin::Support::toJsonValue<qint64>(m_positionTicks);
|
||||
result["IsPlaying"] = Jellyfin::Support::toJsonValue<bool>(m_isPlaying);
|
||||
result["PlaylistItemId"] = Jellyfin::Support::toJsonValue<QUuid>(m_playlistItemId);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -79,6 +80,17 @@ void BufferRequestDto::setPlaylistItemId(QUuid newPlaylistItemId) {
|
|||
m_playlistItemId = newPlaylistItemId;
|
||||
}
|
||||
|
||||
} // 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue