diff options
author | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-01-07 14:20:42 +0100 |
---|---|---|
committer | ksooo <3226626+ksooo@users.noreply.github.com> | 2024-01-07 14:20:42 +0100 |
commit | d7f258104d05afd55813be0cab1c1d2bb7c97f11 (patch) | |
tree | 82817d72e9e38c86a58ed66e8fd928b16a682429 | |
parent | 7dab0dece4261144a936178b37059935c129c0af (diff) |
[video] Fix: When 'default select action' is choose and 'select default version' is off and 'show videos with multiple versions as folder' is off, then a part of default video version was played instead of the part of the version selected by the user.
-rw-r--r-- | xbmc/video/windows/GUIWindowVideoBase.cpp | 11 | ||||
-rw-r--r-- | xbmc/video/windows/GUIWindowVideoBase.h | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index 0737f94d65..6a442992aa 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -569,7 +569,7 @@ public: protected: bool OnPlayPartSelected(unsigned int part) override { - return m_window.OnPlayStackPart(m_itemIndex, part); + return m_window.OnPlayStackPart(m_item, part); } bool OnResumeSelected() override @@ -826,16 +826,13 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but CGUIMediaWindow::GetContextButtons(itemNumber, buttons); } -bool CGUIWindowVideoBase::OnPlayStackPart(int itemIndex, unsigned int partNumber) +bool CGUIWindowVideoBase::OnPlayStackPart(const std::shared_ptr<CFileItem>& item, + unsigned int partNumber) { // part numbers are 1-based. if (partNumber < 1) return false; - if (itemIndex < 0 || itemIndex >= m_vecItems->Size()) - return false; - - const std::shared_ptr<CFileItem> item = m_vecItems->Get(itemIndex); const std::string path = item->GetDynPath(); if (!URIUtils::IsStack(path)) @@ -874,7 +871,7 @@ bool CGUIWindowVideoBase::OnPlayStackPart(int itemIndex, unsigned int partNumber } } // play the video - return OnClick(itemIndex); + return PlayItem(item, ""); } bool CGUIWindowVideoBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button) diff --git a/xbmc/video/windows/GUIWindowVideoBase.h b/xbmc/video/windows/GUIWindowVideoBase.h index 7fe991e657..943db2bad4 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.h +++ b/xbmc/video/windows/GUIWindowVideoBase.h @@ -124,7 +124,7 @@ protected: static bool StackingAvailable(const CFileItemList &items); - bool OnPlayStackPart(int itemIndex, unsigned int partNumber); + bool OnPlayStackPart(const std::shared_ptr<CFileItem>& item, unsigned int partNumber); void UpdateVideoVersionItems(); void UpdateVideoVersionItemsLabel(const std::string& directory); |