diff --git a/core/include/JellyfinQt/loader/requesttypes.h b/core/include/JellyfinQt/loader/requesttypes.h index f5cbab7..f68f249 100644 --- a/core/include/JellyfinQt/loader/requesttypes.h +++ b/core/include/JellyfinQt/loader/requesttypes.h @@ -27728,6 +27728,33 @@ public: void setPlayCommand(PlayCommand newPlayCommand); + /** + * @brief Optional. The index of the audio stream to play. + */ + const qint32 &audioStreamIndex() const; + void setAudioStreamIndex(qint32 newAudioStreamIndex); + bool audioStreamIndexNull() const; + void setAudioStreamIndexNull(); + + + /** + * @brief Optional. The media source id. + */ + const QString &mediaSourceId() const; + void setMediaSourceId(QString newMediaSourceId); + bool mediaSourceIdNull() const; + void setMediaSourceIdNull(); + + + /** + * @brief Optional. The start index. + */ + const qint32 &startIndex() const; + void setStartIndex(qint32 newStartIndex); + bool startIndexNull() const; + void setStartIndexNull(); + + /** * @brief The starting position of the first item. */ @@ -27737,6 +27764,15 @@ public: void setStartPositionTicksNull(); + /** + * @brief Optional. The index of the subtitle stream to play. + */ + const qint32 &subtitleStreamIndex() const; + void setSubtitleStreamIndex(qint32 newSubtitleStreamIndex); + bool subtitleStreamIndexNull() const; + void setSubtitleStreamIndexNull(); + + private: // Required path parameters QString m_sessionId; @@ -27746,7 +27782,11 @@ private: PlayCommand m_playCommand; // Optional query parameters + std::optional m_audioStreamIndex = std::nullopt; + QString m_mediaSourceId; + std::optional m_startIndex = std::nullopt; std::optional m_startPositionTicks = std::nullopt; + std::optional m_subtitleStreamIndex = std::nullopt; }; diff --git a/core/openapi.json b/core/openapi.json index e015c54..09a057c 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -34508,6 +34508,41 @@ "format": "int64", "nullable": true } + }, + { + "name": "mediaSourceId", + "in": "query", + "description": "Optional. The media source id.", + "schema": { + "type": "string" + } + }, + { + "name": "audioStreamIndex", + "in": "query", + "description": "Optional. The index of the audio stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "subtitleStreamIndex", + "in": "query", + "description": "Optional. The index of the subtitle stream to play.", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "startIndex", + "in": "query", + "description": "Optional. The start index.", + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { @@ -55377,4 +55412,4 @@ } } } -} \ No newline at end of file +} diff --git a/core/src/loader/http/session.cpp b/core/src/loader/http/session.cpp index 69ca54c..939cfc3 100644 --- a/core/src/loader/http/session.cpp +++ b/core/src/loader/http/session.cpp @@ -245,6 +245,18 @@ QUrlQuery PlayLoader::query(const PlayParams ¶ms) const { if (!params.startPositionTicksNull()) { result.addQueryItem("startPositionTicks", Support::toString>(params.startPositionTicks())); } + if (!params.mediaSourceIdNull()) { + result.addQueryItem("mediaSourceId", Support::toString(params.mediaSourceId())); + } + if (!params.audioStreamIndexNull()) { + result.addQueryItem("audioStreamIndex", Support::toString>(params.audioStreamIndex())); + } + if (!params.subtitleStreamIndexNull()) { + result.addQueryItem("subtitleStreamIndex", Support::toString>(params.subtitleStreamIndex())); + } + if (!params.startIndexNull()) { + result.addQueryItem("startIndex", Support::toString>(params.startIndex())); + } return result; } diff --git a/core/src/loader/requesttypes.cpp b/core/src/loader/requesttypes.cpp index d1a2489..2c4b771 100644 --- a/core/src/loader/requesttypes.cpp +++ b/core/src/loader/requesttypes.cpp @@ -47966,6 +47966,69 @@ void PlayParams::setPlayCommand(PlayCommand newPlayCommand) { } +const qint32 &PlayParams::audioStreamIndex() const { + return m_audioStreamIndex.value(); +} + +void PlayParams::setAudioStreamIndex(qint32 newAudioStreamIndex) { + m_audioStreamIndex = newAudioStreamIndex; +} + +bool PlayParams::audioStreamIndexNull() const { + // Nullable: true + // Type Nullable: false + + + return !m_audioStreamIndex.has_value(); +} + +void PlayParams::setAudioStreamIndexNull() { + m_audioStreamIndex = std::nullopt; +} + + +const QString &PlayParams::mediaSourceId() const { + return m_mediaSourceId; +} + +void PlayParams::setMediaSourceId(QString newMediaSourceId) { + m_mediaSourceId = newMediaSourceId; +} + +bool PlayParams::mediaSourceIdNull() const { + // Nullable: true + // Type Nullable: true + + + return m_mediaSourceId.isNull(); +} + +void PlayParams::setMediaSourceIdNull() { + m_mediaSourceId.clear(); +} + + +const qint32 &PlayParams::startIndex() const { + return m_startIndex.value(); +} + +void PlayParams::setStartIndex(qint32 newStartIndex) { + m_startIndex = newStartIndex; +} + +bool PlayParams::startIndexNull() const { + // Nullable: true + // Type Nullable: false + + + return !m_startIndex.has_value(); +} + +void PlayParams::setStartIndexNull() { + m_startIndex = std::nullopt; +} + + const qint64 &PlayParams::startPositionTicks() const { return m_startPositionTicks.value(); } @@ -47987,6 +48050,27 @@ void PlayParams::setStartPositionTicksNull() { } +const qint32 &PlayParams::subtitleStreamIndex() const { + return m_subtitleStreamIndex.value(); +} + +void PlayParams::setSubtitleStreamIndex(qint32 newSubtitleStreamIndex) { + m_subtitleStreamIndex = newSubtitleStreamIndex; +} + +bool PlayParams::subtitleStreamIndexNull() const { + // Nullable: true + // Type Nullable: false + + + return !m_subtitleStreamIndex.has_value(); +} + +void PlayParams::setSubtitleStreamIndexNull() { + m_subtitleStreamIndex = std::nullopt; +} + + // PostParams diff --git a/core/src/model/remotejellyfinplayback.cpp b/core/src/model/remotejellyfinplayback.cpp index d895be7..1734423 100644 --- a/core/src/model/remotejellyfinplayback.cpp +++ b/core/src/model/remotejellyfinplayback.cpp @@ -243,7 +243,11 @@ void RemoteJellyfinPlayback::playItemInList(const QStringList &items, int index, } params.setPlayCommand(DTO::PlayCommand::PlayNow); params.setItemIds(items); - //params.setStartIndex(index); + params.setStartIndex(index); + params.setAudioStreamIndex(this->audioIndex()); + if (this->subtitleIndex() >= 0) { + params.setSubtitleStreamIndex(this->subtitleIndex()); + } CommandLoader *loader = new CommandLoader(&m_apiClient); loader->setParameters(params);