aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2024-01-08 15:27:01 +0000
committerGitHub <noreply@github.com>2024-01-08 15:27:01 +0000
commit9f58fca8ea5ee7510341ee7c46e86a5755ce4315 (patch)
treefcbb9e136f4156dc98aed652d8eaf792acaca060
parent050d2af79c838a4fa55fb9093e20811f662959b7 (diff)
parentf6dd52e3aee595ddb6b6079253db51dd00a710b4 (diff)
Merge pull request #24461 from enen92/isplayable_utils
[guilib][utils] Set IsPlayable false on add items
-rw-r--r--xbmc/music/MusicUtils.cpp6
-rw-r--r--xbmc/video/VideoUtils.cpp6
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp1
-rw-r--r--xbmc/windows/GUIWindowFileManager.cpp1
4 files changed, 8 insertions, 6 deletions
diff --git a/xbmc/music/MusicUtils.cpp b/xbmc/music/MusicUtils.cpp
index 0b0d13e556..ff68f9b274 100644
--- a/xbmc/music/MusicUtils.cpp
+++ b/xbmc/music/MusicUtils.cpp
@@ -930,10 +930,10 @@ bool IsItemPlayable(const CFileItem& item)
return true;
else if (item.m_bIsFolder)
{
- // Not a music-specific folder (just file:// or nfs://). Allow play if context is Music window.
- if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_MUSIC_NAV &&
- item.GetPath() != "add") // Exclude "Add music source" item
+ if (!item.HasProperty("IsPlayable") || item.GetProperty("IsPlayable").asBoolean())
+ {
return true;
+ }
}
return false;
}
diff --git a/xbmc/video/VideoUtils.cpp b/xbmc/video/VideoUtils.cpp
index 4122347d17..055f54e205 100644
--- a/xbmc/video/VideoUtils.cpp
+++ b/xbmc/video/VideoUtils.cpp
@@ -606,10 +606,10 @@ bool IsItemPlayable(const CFileItem& item)
}
else if (item.m_bIsFolder)
{
- // Not a video-specific folder (like file:// or nfs://). Allow play if context is Video window.
- if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_VIDEO_NAV &&
- item.GetPath() != "add") // Exclude "Add video source" item
+ if (!item.HasProperty("IsPlayable") || item.GetProperty("IsPlayable").asBoolean())
+ {
return true;
+ }
}
return false;
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index 5dacf417a1..a261ecd702 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -907,6 +907,7 @@ bool CGUIMediaWindow::Update(const std::string &strDirectory, bool updateFilterP
const std::string& strLabel = g_localizeStrings.Get(showLabel);
CFileItemPtr pItem(new CFileItem(strLabel));
pItem->SetPath("add");
+ pItem->SetProperty("IsPlayable", false);
pItem->SetArt("icon", "DefaultAddSource.png");
pItem->SetLabel(strLabel);
pItem->SetLabelPreformatted(true);
diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp
index 966fd74fb0..59ba24245f 100644
--- a/xbmc/windows/GUIWindowFileManager.cpp
+++ b/xbmc/windows/GUIWindowFileManager.cpp
@@ -493,6 +493,7 @@ bool CGUIWindowFileManager::Update(int iList, const std::string &strDirectory)
const std::string& strLabel = g_localizeStrings.Get(1026);
CFileItemPtr pItem(new CFileItem(strLabel));
pItem->SetPath("add");
+ pItem->SetProperty("IsPlayable", false);
pItem->SetArt("icon", "DefaultAddSource.png");
pItem->SetLabel(strLabel);
pItem->SetLabelPreformatted(true);