From a5316f7161f5ffecde70637f4745abb647f20f50 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:15:19 +0100 Subject: [PATCH] [video] Fix video info dialog play button to always play the version that info is displayed for, not to queue and play all versions of the movie when 'show videos with multiple versions as folder' is ON. --- xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index 66cc164854edf..0f838f1f013b2 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -753,11 +753,19 @@ class CVideoPlayActionProcessor : public VIDEO::GUILIB::CVideoPlayActionProcesso private: void Play() { - m_item->SetProperty("playlist_type_hint", PLAYLIST::TYPE_VIDEO); - const ContentUtils::PlayMode mode{m_item->GetProperty("CheckAutoPlayNextItem").asBoolean() + auto item{m_item}; + if (item->m_bIsFolder && item->HasVideoVersions()) + { + //! @todo get rid of "videos with versions as folder" hack! + item = std::make_shared(*item); + item->m_bIsFolder = false; + } + + item->SetProperty("playlist_type_hint", PLAYLIST::TYPE_VIDEO); + const ContentUtils::PlayMode mode{item->GetProperty("CheckAutoPlayNextItem").asBoolean() ? ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM : ContentUtils::PlayMode::PLAY_ONLY_THIS}; - VIDEO_UTILS::PlayItem(m_item, "", mode); + VIDEO_UTILS::PlayItem(item, "", mode); } }; } // unnamed namespace