aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2024-05-04 23:55:32 +0100
committerGitHub <noreply@github.com>2024-05-04 23:55:32 +0100
commitdb1f89bc9242f1603256555d82da92e0dacc36e7 (patch)
tree1afbe7d96039cd37c89b7698e94ba0cff87c56d4
parent08948981a77af5856b9a6d925e718e2277e75688 (diff)
parent7a69d0dc10c2e65b97cfe7cf6fae18478ec276be (diff)
downloadxbmc-db1f89bc9242f1603256555d82da92e0dacc36e7.tar.xz
Merge pull request #25099 from 78andyp/playlist_fix
[Video] Fix for #25097 and requested updates from #24720
-rw-r--r--addons/resource.language.en_gb/resources/strings.po3
-rw-r--r--xbmc/application/Application.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogSimpleMenu.cpp16
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp18
4 files changed, 14 insertions, 25 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 162bd67ca1..e72dc01c99 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -7289,6 +7289,9 @@ msgctxt "#13423"
msgid "Remember for this path"
msgstr ""
+#. Shown on context menu when a bluray:// or dvd:// playlist has already been saved
+#. Giving the user a chance to select a new one via the simple menu dialog
+#: xbmc/video/windows/GUIWindowVideoBase.cpp
msgctxt "#13424"
msgid "Choose playlist"
msgstr ""
diff --git a/xbmc/application/Application.cpp b/xbmc/application/Application.cpp
index 6741845c75..3a47546904 100644
--- a/xbmc/application/Application.cpp
+++ b/xbmc/application/Application.cpp
@@ -2429,7 +2429,7 @@ bool CApplication::PlayFile(CFileItem item,
// a disc image might be Blu-Ray disc
if (!(options.startpercent > 0.0 || options.starttime > 0.0) &&
(VIDEO::IsBDFile(item) || item.IsDiscImage() ||
- (VIDEO::IsBlurayPlaylist(item) && forceSelection)))
+ (forceSelection && VIDEO::IsBlurayPlaylist(item))))
{
// No video selection when using external or remote players (they handle it if supported)
const bool isSimpleMenuAllowed = [&]()
diff --git a/xbmc/dialogs/GUIDialogSimpleMenu.cpp b/xbmc/dialogs/GUIDialogSimpleMenu.cpp
index 2049e2615c..fed153fb16 100644
--- a/xbmc/dialogs/GUIDialogSimpleMenu.cpp
+++ b/xbmc/dialogs/GUIDialogSimpleMenu.cpp
@@ -29,8 +29,6 @@
#include "video/VideoFileItemClassify.h"
#include "video/VideoInfoTag.h"
-std::string m_savePath;
-
using namespace KODI;
namespace
@@ -59,10 +57,9 @@ bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, bool forceSelectio
if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_DISC_PLAYBACK) != BD_PLAYBACK_SIMPLE_MENU)
return true;
- m_savePath = "";
- if (VIDEO::IsBlurayPlaylist(item) && forceSelection)
+ if (forceSelection && VIDEO::IsBlurayPlaylist(item))
{
- m_savePath = item.GetDynPath(); // save for screen refresh later
+ item.SetProperty("save_dyn_path", item.GetDynPath()); // save for screen refresh later
item.SetDynPath(item.GetBlurayPath());
}
@@ -135,11 +132,14 @@ bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item, const std::string&
if (item_new->m_bIsFolder == false)
{
- if (m_savePath.empty()) // If not set above (choose playlist selected)
- m_savePath = item.GetDynPath();
+ std::string path;
+ if (item.HasProperty("save_dyn_path"))
+ path = item.GetProperty("save_dyn_path").asString();
+ else
+ path = item.GetDynPath(); // If not set above (choose playlist selected)
item.SetDynPath(item_new->GetDynPath());
item.SetProperty("get_stream_details_from_player", true);
- item.SetProperty("original_listitem_url", m_savePath);
+ item.SetProperty("original_listitem_url", path);
return true;
}
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index 4e6464e48e..62cf70e6d0 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -60,12 +60,8 @@
#include "utils/URIUtils.h"
#include "utils/Variant.h"
#include "utils/log.h"
-#include "video/VideoFileItemClassify.h"
-#include "video/VideoInfoTag.h"
#include "view/GUIViewState.h"
-#include <inttypes.h>
-
#define CONTROL_BTNVIEWASICONS 2
#define CONTROL_BTNSORTBY 3
#define CONTROL_BTNSORTASC 4
@@ -1537,21 +1533,11 @@ bool CGUIMediaWindow::OnPlayAndQueueMedia(const CFileItemPtr& item, const std::s
{ return i->IsZIP() || i->IsRAR() || i->m_bIsFolder; }),
playlist.end());
- // Remove duplicates (eg. ISO/VIDEO_TS)
- playlist.erase(
- std::unique(playlist.begin(), playlist.end(),
- [](const std::shared_ptr<CFileItem>& i, const std::shared_ptr<CFileItem>& j) {
- return i->GetVideoInfoTag()->m_basePath == j->GetVideoInfoTag()->m_basePath;
- }),
- playlist.end());
-
// Chosen item
int mediaToPlay =
std::distance(playlist.begin(), std::find_if(playlist.begin(), playlist.end(),
- [&item](const std::shared_ptr<CFileItem>& i) {
- return i->GetVideoInfoTag()->m_basePath ==
- item->GetVideoInfoTag()->m_basePath;
- }));
+ [&item](const std::shared_ptr<CFileItem>& i)
+ { return i->GetPath() == item->GetPath(); }));
// Add to playlist
CServiceBroker::GetPlaylistPlayer().ClearPlaylist(playlistId);