/* * Sailfin: a Jellyfin client written using Qt * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET * OVERWRITTEN AT SOME POINT! * * If there is a bug in this file, please fix the code generator used to generate this file found in * core/openapigenerator.d. * * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that * file with a newer file if needed instead of manually updating the files. */ #include namespace Jellyfin { namespace DTO { MediaSourceInfo::MediaSourceInfo() {} MediaSourceInfo::MediaSourceInfo(const MediaSourceInfo &other) : m_protocol(other.m_protocol), m_jellyfinId(other.m_jellyfinId), m_path(other.m_path), m_encoderPath(other.m_encoderPath), m_encoderProtocol(other.m_encoderProtocol), m_type(other.m_type), m_container(other.m_container), m_size(other.m_size), m_name(other.m_name), m_isRemote(other.m_isRemote), m_eTag(other.m_eTag), m_runTimeTicks(other.m_runTimeTicks), m_readAtNativeFramerate(other.m_readAtNativeFramerate), m_ignoreDts(other.m_ignoreDts), m_ignoreIndex(other.m_ignoreIndex), m_genPtsInput(other.m_genPtsInput), m_supportsTranscoding(other.m_supportsTranscoding), m_supportsDirectStream(other.m_supportsDirectStream), m_supportsDirectPlay(other.m_supportsDirectPlay), m_isInfiniteStream(other.m_isInfiniteStream), m_requiresOpening(other.m_requiresOpening), m_openToken(other.m_openToken), m_requiresClosing(other.m_requiresClosing), m_liveStreamId(other.m_liveStreamId), m_bufferMs(other.m_bufferMs), m_requiresLooping(other.m_requiresLooping), m_supportsProbing(other.m_supportsProbing), m_videoType(other.m_videoType), m_isoType(other.m_isoType), m_video3DFormat(other.m_video3DFormat), m_mediaStreams(other.m_mediaStreams), m_mediaAttachments(other.m_mediaAttachments), m_formats(other.m_formats), m_bitrate(other.m_bitrate), m_timestamp(other.m_timestamp), m_requiredHttpHeaders(other.m_requiredHttpHeaders), m_transcodingUrl(other.m_transcodingUrl), m_transcodingSubProtocol(other.m_transcodingSubProtocol), m_transcodingContainer(other.m_transcodingContainer), m_analyzeDurationMs(other.m_analyzeDurationMs), m_defaultAudioStreamIndex(other.m_defaultAudioStreamIndex), m_defaultSubtitleStreamIndex(other.m_defaultSubtitleStreamIndex){} void MediaSourceInfo::replaceData(MediaSourceInfo &other) { m_protocol = other.m_protocol; m_jellyfinId = other.m_jellyfinId; m_path = other.m_path; m_encoderPath = other.m_encoderPath; m_encoderProtocol = other.m_encoderProtocol; m_type = other.m_type; m_container = other.m_container; m_size = other.m_size; m_name = other.m_name; m_isRemote = other.m_isRemote; m_eTag = other.m_eTag; m_runTimeTicks = other.m_runTimeTicks; m_readAtNativeFramerate = other.m_readAtNativeFramerate; m_ignoreDts = other.m_ignoreDts; m_ignoreIndex = other.m_ignoreIndex; m_genPtsInput = other.m_genPtsInput; m_supportsTranscoding = other.m_supportsTranscoding; m_supportsDirectStream = other.m_supportsDirectStream; m_supportsDirectPlay = other.m_supportsDirectPlay; m_isInfiniteStream = other.m_isInfiniteStream; m_requiresOpening = other.m_requiresOpening; m_openToken = other.m_openToken; m_requiresClosing = other.m_requiresClosing; m_liveStreamId = other.m_liveStreamId; m_bufferMs = other.m_bufferMs; m_requiresLooping = other.m_requiresLooping; m_supportsProbing = other.m_supportsProbing; m_videoType = other.m_videoType; m_isoType = other.m_isoType; m_video3DFormat = other.m_video3DFormat; m_mediaStreams = other.m_mediaStreams; m_mediaAttachments = other.m_mediaAttachments; m_formats = other.m_formats; m_bitrate = other.m_bitrate; m_timestamp = other.m_timestamp; m_requiredHttpHeaders = other.m_requiredHttpHeaders; m_transcodingUrl = other.m_transcodingUrl; m_transcodingSubProtocol = other.m_transcodingSubProtocol; m_transcodingContainer = other.m_transcodingContainer; m_analyzeDurationMs = other.m_analyzeDurationMs; m_defaultAudioStreamIndex = other.m_defaultAudioStreamIndex; m_defaultSubtitleStreamIndex = other.m_defaultSubtitleStreamIndex; } MediaSourceInfo MediaSourceInfo::fromJson(QJsonObject source) { MediaSourceInfo instance; instance.setFromJson(source); return instance; } void MediaSourceInfo::setFromJson(QJsonObject source) { m_protocol = Jellyfin::Support::fromJsonValue(source["Protocol"]); m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_encoderPath = Jellyfin::Support::fromJsonValue(source["EncoderPath"]); m_encoderProtocol = Jellyfin::Support::fromJsonValue(source["EncoderProtocol"]); m_type = Jellyfin::Support::fromJsonValue(source["Type"]); m_container = Jellyfin::Support::fromJsonValue(source["Container"]); m_size = Jellyfin::Support::fromJsonValue>(source["Size"]); m_name = Jellyfin::Support::fromJsonValue(source["Name"]); m_isRemote = Jellyfin::Support::fromJsonValue(source["IsRemote"]); m_eTag = Jellyfin::Support::fromJsonValue(source["ETag"]); m_runTimeTicks = Jellyfin::Support::fromJsonValue>(source["RunTimeTicks"]); m_readAtNativeFramerate = Jellyfin::Support::fromJsonValue(source["ReadAtNativeFramerate"]); m_ignoreDts = Jellyfin::Support::fromJsonValue(source["IgnoreDts"]); m_ignoreIndex = Jellyfin::Support::fromJsonValue(source["IgnoreIndex"]); m_genPtsInput = Jellyfin::Support::fromJsonValue(source["GenPtsInput"]); m_supportsTranscoding = Jellyfin::Support::fromJsonValue(source["SupportsTranscoding"]); m_supportsDirectStream = Jellyfin::Support::fromJsonValue(source["SupportsDirectStream"]); m_supportsDirectPlay = Jellyfin::Support::fromJsonValue(source["SupportsDirectPlay"]); m_isInfiniteStream = Jellyfin::Support::fromJsonValue(source["IsInfiniteStream"]); m_requiresOpening = Jellyfin::Support::fromJsonValue(source["RequiresOpening"]); m_openToken = Jellyfin::Support::fromJsonValue(source["OpenToken"]); m_requiresClosing = Jellyfin::Support::fromJsonValue(source["RequiresClosing"]); m_liveStreamId = Jellyfin::Support::fromJsonValue(source["LiveStreamId"]); m_bufferMs = Jellyfin::Support::fromJsonValue>(source["BufferMs"]); m_requiresLooping = Jellyfin::Support::fromJsonValue(source["RequiresLooping"]); m_supportsProbing = Jellyfin::Support::fromJsonValue(source["SupportsProbing"]); m_videoType = Jellyfin::Support::fromJsonValue(source["VideoType"]); m_isoType = Jellyfin::Support::fromJsonValue(source["IsoType"]); m_video3DFormat = Jellyfin::Support::fromJsonValue(source["Video3DFormat"]); m_mediaStreams = Jellyfin::Support::fromJsonValue>(source["MediaStreams"]); m_mediaAttachments = Jellyfin::Support::fromJsonValue>(source["MediaAttachments"]); m_formats = Jellyfin::Support::fromJsonValue(source["Formats"]); m_bitrate = Jellyfin::Support::fromJsonValue>(source["Bitrate"]); m_timestamp = Jellyfin::Support::fromJsonValue(source["Timestamp"]); m_requiredHttpHeaders = Jellyfin::Support::fromJsonValue(source["RequiredHttpHeaders"]); m_transcodingUrl = Jellyfin::Support::fromJsonValue(source["TranscodingUrl"]); m_transcodingSubProtocol = Jellyfin::Support::fromJsonValue(source["TranscodingSubProtocol"]); m_transcodingContainer = Jellyfin::Support::fromJsonValue(source["TranscodingContainer"]); m_analyzeDurationMs = Jellyfin::Support::fromJsonValue>(source["AnalyzeDurationMs"]); m_defaultAudioStreamIndex = Jellyfin::Support::fromJsonValue>(source["DefaultAudioStreamIndex"]); m_defaultSubtitleStreamIndex = Jellyfin::Support::fromJsonValue>(source["DefaultSubtitleStreamIndex"]); } QJsonObject MediaSourceInfo::toJson() const { QJsonObject result; result["Protocol"] = Jellyfin::Support::toJsonValue(m_protocol); if (!(m_jellyfinId.isNull())) { result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); } if (!(m_path.isNull())) { result["Path"] = Jellyfin::Support::toJsonValue(m_path); } if (!(m_encoderPath.isNull())) { result["EncoderPath"] = Jellyfin::Support::toJsonValue(m_encoderPath); } result["EncoderProtocol"] = Jellyfin::Support::toJsonValue(m_encoderProtocol); result["Type"] = Jellyfin::Support::toJsonValue(m_type); if (!(m_container.isNull())) { result["Container"] = Jellyfin::Support::toJsonValue(m_container); } if (!(!m_size.has_value())) { result["Size"] = Jellyfin::Support::toJsonValue>(m_size); } if (!(m_name.isNull())) { result["Name"] = Jellyfin::Support::toJsonValue(m_name); } result["IsRemote"] = Jellyfin::Support::toJsonValue(m_isRemote); if (!(m_eTag.isNull())) { result["ETag"] = Jellyfin::Support::toJsonValue(m_eTag); } if (!(!m_runTimeTicks.has_value())) { result["RunTimeTicks"] = Jellyfin::Support::toJsonValue>(m_runTimeTicks); } result["ReadAtNativeFramerate"] = Jellyfin::Support::toJsonValue(m_readAtNativeFramerate); result["IgnoreDts"] = Jellyfin::Support::toJsonValue(m_ignoreDts); result["IgnoreIndex"] = Jellyfin::Support::toJsonValue(m_ignoreIndex); result["GenPtsInput"] = Jellyfin::Support::toJsonValue(m_genPtsInput); result["SupportsTranscoding"] = Jellyfin::Support::toJsonValue(m_supportsTranscoding); result["SupportsDirectStream"] = Jellyfin::Support::toJsonValue(m_supportsDirectStream); result["SupportsDirectPlay"] = Jellyfin::Support::toJsonValue(m_supportsDirectPlay); result["IsInfiniteStream"] = Jellyfin::Support::toJsonValue(m_isInfiniteStream); result["RequiresOpening"] = Jellyfin::Support::toJsonValue(m_requiresOpening); if (!(m_openToken.isNull())) { result["OpenToken"] = Jellyfin::Support::toJsonValue(m_openToken); } result["RequiresClosing"] = Jellyfin::Support::toJsonValue(m_requiresClosing); if (!(m_liveStreamId.isNull())) { result["LiveStreamId"] = Jellyfin::Support::toJsonValue(m_liveStreamId); } if (!(!m_bufferMs.has_value())) { result["BufferMs"] = Jellyfin::Support::toJsonValue>(m_bufferMs); } result["RequiresLooping"] = Jellyfin::Support::toJsonValue(m_requiresLooping); result["SupportsProbing"] = Jellyfin::Support::toJsonValue(m_supportsProbing); result["VideoType"] = Jellyfin::Support::toJsonValue(m_videoType); result["IsoType"] = Jellyfin::Support::toJsonValue(m_isoType); result["Video3DFormat"] = Jellyfin::Support::toJsonValue(m_video3DFormat); if (!(m_mediaStreams.size() == 0)) { result["MediaStreams"] = Jellyfin::Support::toJsonValue>(m_mediaStreams); } if (!(m_mediaAttachments.size() == 0)) { result["MediaAttachments"] = Jellyfin::Support::toJsonValue>(m_mediaAttachments); } if (!(m_formats.size() == 0)) { result["Formats"] = Jellyfin::Support::toJsonValue(m_formats); } if (!(!m_bitrate.has_value())) { result["Bitrate"] = Jellyfin::Support::toJsonValue>(m_bitrate); } result["Timestamp"] = Jellyfin::Support::toJsonValue(m_timestamp); if (!(m_requiredHttpHeaders.isEmpty())) { result["RequiredHttpHeaders"] = Jellyfin::Support::toJsonValue(m_requiredHttpHeaders); } if (!(m_transcodingUrl.isNull())) { result["TranscodingUrl"] = Jellyfin::Support::toJsonValue(m_transcodingUrl); } if (!(m_transcodingSubProtocol.isNull())) { result["TranscodingSubProtocol"] = Jellyfin::Support::toJsonValue(m_transcodingSubProtocol); } if (!(m_transcodingContainer.isNull())) { result["TranscodingContainer"] = Jellyfin::Support::toJsonValue(m_transcodingContainer); } if (!(!m_analyzeDurationMs.has_value())) { result["AnalyzeDurationMs"] = Jellyfin::Support::toJsonValue>(m_analyzeDurationMs); } if (!(!m_defaultAudioStreamIndex.has_value())) { result["DefaultAudioStreamIndex"] = Jellyfin::Support::toJsonValue>(m_defaultAudioStreamIndex); } if (!(!m_defaultSubtitleStreamIndex.has_value())) { result["DefaultSubtitleStreamIndex"] = Jellyfin::Support::toJsonValue>(m_defaultSubtitleStreamIndex); } return result; } MediaProtocol MediaSourceInfo::protocol() const { return m_protocol; } void MediaSourceInfo::setProtocol(MediaProtocol newProtocol) { m_protocol = newProtocol; } QString MediaSourceInfo::jellyfinId() const { return m_jellyfinId; } void MediaSourceInfo::setJellyfinId(QString newJellyfinId) { m_jellyfinId = newJellyfinId; } bool MediaSourceInfo::jellyfinIdNull() const { return m_jellyfinId.isNull(); } void MediaSourceInfo::setJellyfinIdNull() { m_jellyfinId.clear(); } QString MediaSourceInfo::path() const { return m_path; } void MediaSourceInfo::setPath(QString newPath) { m_path = newPath; } bool MediaSourceInfo::pathNull() const { return m_path.isNull(); } void MediaSourceInfo::setPathNull() { m_path.clear(); } QString MediaSourceInfo::encoderPath() const { return m_encoderPath; } void MediaSourceInfo::setEncoderPath(QString newEncoderPath) { m_encoderPath = newEncoderPath; } bool MediaSourceInfo::encoderPathNull() const { return m_encoderPath.isNull(); } void MediaSourceInfo::setEncoderPathNull() { m_encoderPath.clear(); } MediaProtocol MediaSourceInfo::encoderProtocol() const { return m_encoderProtocol; } void MediaSourceInfo::setEncoderProtocol(MediaProtocol newEncoderProtocol) { m_encoderProtocol = newEncoderProtocol; } MediaSourceType MediaSourceInfo::type() const { return m_type; } void MediaSourceInfo::setType(MediaSourceType newType) { m_type = newType; } QString MediaSourceInfo::container() const { return m_container; } void MediaSourceInfo::setContainer(QString newContainer) { m_container = newContainer; } bool MediaSourceInfo::containerNull() const { return m_container.isNull(); } void MediaSourceInfo::setContainerNull() { m_container.clear(); } std::optional MediaSourceInfo::size() const { return m_size; } void MediaSourceInfo::setSize(std::optional newSize) { m_size = newSize; } bool MediaSourceInfo::sizeNull() const { return !m_size.has_value(); } void MediaSourceInfo::setSizeNull() { m_size = std::nullopt; } QString MediaSourceInfo::name() const { return m_name; } void MediaSourceInfo::setName(QString newName) { m_name = newName; } bool MediaSourceInfo::nameNull() const { return m_name.isNull(); } void MediaSourceInfo::setNameNull() { m_name.clear(); } bool MediaSourceInfo::isRemote() const { return m_isRemote; } void MediaSourceInfo::setIsRemote(bool newIsRemote) { m_isRemote = newIsRemote; } QString MediaSourceInfo::eTag() const { return m_eTag; } void MediaSourceInfo::setETag(QString newETag) { m_eTag = newETag; } bool MediaSourceInfo::eTagNull() const { return m_eTag.isNull(); } void MediaSourceInfo::setETagNull() { m_eTag.clear(); } std::optional MediaSourceInfo::runTimeTicks() const { return m_runTimeTicks; } void MediaSourceInfo::setRunTimeTicks(std::optional newRunTimeTicks) { m_runTimeTicks = newRunTimeTicks; } bool MediaSourceInfo::runTimeTicksNull() const { return !m_runTimeTicks.has_value(); } void MediaSourceInfo::setRunTimeTicksNull() { m_runTimeTicks = std::nullopt; } bool MediaSourceInfo::readAtNativeFramerate() const { return m_readAtNativeFramerate; } void MediaSourceInfo::setReadAtNativeFramerate(bool newReadAtNativeFramerate) { m_readAtNativeFramerate = newReadAtNativeFramerate; } bool MediaSourceInfo::ignoreDts() const { return m_ignoreDts; } void MediaSourceInfo::setIgnoreDts(bool newIgnoreDts) { m_ignoreDts = newIgnoreDts; } bool MediaSourceInfo::ignoreIndex() const { return m_ignoreIndex; } void MediaSourceInfo::setIgnoreIndex(bool newIgnoreIndex) { m_ignoreIndex = newIgnoreIndex; } bool MediaSourceInfo::genPtsInput() const { return m_genPtsInput; } void MediaSourceInfo::setGenPtsInput(bool newGenPtsInput) { m_genPtsInput = newGenPtsInput; } bool MediaSourceInfo::supportsTranscoding() const { return m_supportsTranscoding; } void MediaSourceInfo::setSupportsTranscoding(bool newSupportsTranscoding) { m_supportsTranscoding = newSupportsTranscoding; } bool MediaSourceInfo::supportsDirectStream() const { return m_supportsDirectStream; } void MediaSourceInfo::setSupportsDirectStream(bool newSupportsDirectStream) { m_supportsDirectStream = newSupportsDirectStream; } bool MediaSourceInfo::supportsDirectPlay() const { return m_supportsDirectPlay; } void MediaSourceInfo::setSupportsDirectPlay(bool newSupportsDirectPlay) { m_supportsDirectPlay = newSupportsDirectPlay; } bool MediaSourceInfo::isInfiniteStream() const { return m_isInfiniteStream; } void MediaSourceInfo::setIsInfiniteStream(bool newIsInfiniteStream) { m_isInfiniteStream = newIsInfiniteStream; } bool MediaSourceInfo::requiresOpening() const { return m_requiresOpening; } void MediaSourceInfo::setRequiresOpening(bool newRequiresOpening) { m_requiresOpening = newRequiresOpening; } QString MediaSourceInfo::openToken() const { return m_openToken; } void MediaSourceInfo::setOpenToken(QString newOpenToken) { m_openToken = newOpenToken; } bool MediaSourceInfo::openTokenNull() const { return m_openToken.isNull(); } void MediaSourceInfo::setOpenTokenNull() { m_openToken.clear(); } bool MediaSourceInfo::requiresClosing() const { return m_requiresClosing; } void MediaSourceInfo::setRequiresClosing(bool newRequiresClosing) { m_requiresClosing = newRequiresClosing; } QString MediaSourceInfo::liveStreamId() const { return m_liveStreamId; } void MediaSourceInfo::setLiveStreamId(QString newLiveStreamId) { m_liveStreamId = newLiveStreamId; } bool MediaSourceInfo::liveStreamIdNull() const { return m_liveStreamId.isNull(); } void MediaSourceInfo::setLiveStreamIdNull() { m_liveStreamId.clear(); } std::optional MediaSourceInfo::bufferMs() const { return m_bufferMs; } void MediaSourceInfo::setBufferMs(std::optional newBufferMs) { m_bufferMs = newBufferMs; } bool MediaSourceInfo::bufferMsNull() const { return !m_bufferMs.has_value(); } void MediaSourceInfo::setBufferMsNull() { m_bufferMs = std::nullopt; } bool MediaSourceInfo::requiresLooping() const { return m_requiresLooping; } void MediaSourceInfo::setRequiresLooping(bool newRequiresLooping) { m_requiresLooping = newRequiresLooping; } bool MediaSourceInfo::supportsProbing() const { return m_supportsProbing; } void MediaSourceInfo::setSupportsProbing(bool newSupportsProbing) { m_supportsProbing = newSupportsProbing; } VideoType MediaSourceInfo::videoType() const { return m_videoType; } void MediaSourceInfo::setVideoType(VideoType newVideoType) { m_videoType = newVideoType; } IsoType MediaSourceInfo::isoType() const { return m_isoType; } void MediaSourceInfo::setIsoType(IsoType newIsoType) { m_isoType = newIsoType; } Video3DFormat MediaSourceInfo::video3DFormat() const { return m_video3DFormat; } void MediaSourceInfo::setVideo3DFormat(Video3DFormat newVideo3DFormat) { m_video3DFormat = newVideo3DFormat; } QList MediaSourceInfo::mediaStreams() const { return m_mediaStreams; } void MediaSourceInfo::setMediaStreams(QList newMediaStreams) { m_mediaStreams = newMediaStreams; } bool MediaSourceInfo::mediaStreamsNull() const { return m_mediaStreams.size() == 0; } void MediaSourceInfo::setMediaStreamsNull() { m_mediaStreams.clear(); } QList MediaSourceInfo::mediaAttachments() const { return m_mediaAttachments; } void MediaSourceInfo::setMediaAttachments(QList newMediaAttachments) { m_mediaAttachments = newMediaAttachments; } bool MediaSourceInfo::mediaAttachmentsNull() const { return m_mediaAttachments.size() == 0; } void MediaSourceInfo::setMediaAttachmentsNull() { m_mediaAttachments.clear(); } QStringList MediaSourceInfo::formats() const { return m_formats; } void MediaSourceInfo::setFormats(QStringList newFormats) { m_formats = newFormats; } bool MediaSourceInfo::formatsNull() const { return m_formats.size() == 0; } void MediaSourceInfo::setFormatsNull() { m_formats.clear(); } std::optional MediaSourceInfo::bitrate() const { return m_bitrate; } void MediaSourceInfo::setBitrate(std::optional newBitrate) { m_bitrate = newBitrate; } bool MediaSourceInfo::bitrateNull() const { return !m_bitrate.has_value(); } void MediaSourceInfo::setBitrateNull() { m_bitrate = std::nullopt; } TransportStreamTimestamp MediaSourceInfo::timestamp() const { return m_timestamp; } void MediaSourceInfo::setTimestamp(TransportStreamTimestamp newTimestamp) { m_timestamp = newTimestamp; } QJsonObject MediaSourceInfo::requiredHttpHeaders() const { return m_requiredHttpHeaders; } void MediaSourceInfo::setRequiredHttpHeaders(QJsonObject newRequiredHttpHeaders) { m_requiredHttpHeaders = newRequiredHttpHeaders; } bool MediaSourceInfo::requiredHttpHeadersNull() const { return m_requiredHttpHeaders.isEmpty(); } void MediaSourceInfo::setRequiredHttpHeadersNull() { m_requiredHttpHeaders= QJsonObject(); } QString MediaSourceInfo::transcodingUrl() const { return m_transcodingUrl; } void MediaSourceInfo::setTranscodingUrl(QString newTranscodingUrl) { m_transcodingUrl = newTranscodingUrl; } bool MediaSourceInfo::transcodingUrlNull() const { return m_transcodingUrl.isNull(); } void MediaSourceInfo::setTranscodingUrlNull() { m_transcodingUrl.clear(); } QString MediaSourceInfo::transcodingSubProtocol() const { return m_transcodingSubProtocol; } void MediaSourceInfo::setTranscodingSubProtocol(QString newTranscodingSubProtocol) { m_transcodingSubProtocol = newTranscodingSubProtocol; } bool MediaSourceInfo::transcodingSubProtocolNull() const { return m_transcodingSubProtocol.isNull(); } void MediaSourceInfo::setTranscodingSubProtocolNull() { m_transcodingSubProtocol.clear(); } QString MediaSourceInfo::transcodingContainer() const { return m_transcodingContainer; } void MediaSourceInfo::setTranscodingContainer(QString newTranscodingContainer) { m_transcodingContainer = newTranscodingContainer; } bool MediaSourceInfo::transcodingContainerNull() const { return m_transcodingContainer.isNull(); } void MediaSourceInfo::setTranscodingContainerNull() { m_transcodingContainer.clear(); } std::optional MediaSourceInfo::analyzeDurationMs() const { return m_analyzeDurationMs; } void MediaSourceInfo::setAnalyzeDurationMs(std::optional newAnalyzeDurationMs) { m_analyzeDurationMs = newAnalyzeDurationMs; } bool MediaSourceInfo::analyzeDurationMsNull() const { return !m_analyzeDurationMs.has_value(); } void MediaSourceInfo::setAnalyzeDurationMsNull() { m_analyzeDurationMs = std::nullopt; } std::optional MediaSourceInfo::defaultAudioStreamIndex() const { return m_defaultAudioStreamIndex; } void MediaSourceInfo::setDefaultAudioStreamIndex(std::optional newDefaultAudioStreamIndex) { m_defaultAudioStreamIndex = newDefaultAudioStreamIndex; } bool MediaSourceInfo::defaultAudioStreamIndexNull() const { return !m_defaultAudioStreamIndex.has_value(); } void MediaSourceInfo::setDefaultAudioStreamIndexNull() { m_defaultAudioStreamIndex = std::nullopt; } std::optional MediaSourceInfo::defaultSubtitleStreamIndex() const { return m_defaultSubtitleStreamIndex; } void MediaSourceInfo::setDefaultSubtitleStreamIndex(std::optional newDefaultSubtitleStreamIndex) { m_defaultSubtitleStreamIndex = newDefaultSubtitleStreamIndex; } bool MediaSourceInfo::defaultSubtitleStreamIndexNull() const { return !m_defaultSubtitleStreamIndex.has_value(); } void MediaSourceInfo::setDefaultSubtitleStreamIndexNull() { m_defaultSubtitleStreamIndex = std::nullopt; } } // NS DTO namespace Support { using MediaSourceInfo = Jellyfin::DTO::MediaSourceInfo; template <> MediaSourceInfo fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return MediaSourceInfo::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const MediaSourceInfo &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin