Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Video] Fix for #25097 and requested updates from #24720 #25099

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion xbmc/application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [&]()
Expand Down
16 changes: 8 additions & 8 deletions xbmc/dialogs/GUIDialogSimpleMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include "video/VideoFileItemClassify.h"
#include "video/VideoInfoTag.h"

std::string m_savePath;

using namespace KODI;

namespace
Expand Down Expand Up @@ -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());
}

Expand Down Expand Up @@ -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;
}

Expand Down
18 changes: 2 additions & 16 deletions xbmc/windows/GUIMediaWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(); }));
ksooo marked this conversation as resolved.
Show resolved Hide resolved

// Add to playlist
CServiceBroker::GetPlaylistPlayer().ClearPlaylist(playlistId);
Expand Down