aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2020-10-02 23:25:53 +0200
committerGitHub <noreply@github.com>2020-10-02 23:25:53 +0200
commit2d993a1e09427653dec6f2a7ab8972292a3e49e2 (patch)
tree6aaebad2417daa6f3145df492b7d47fa479a7388
parent9b6a800f6940ef68c9c216678fc2c8d3e0435c35 (diff)
parent6dbd18b8a946c52fa61e6653bc58364bdc4d357b (diff)
Merge pull request #18496 from ksooo/pvr-parentfolder-ctx-menu
[video][pvr] Remove context menu items from recordings window's '..' entries
-rw-r--r--xbmc/pvr/PVRContextMenus.cpp2
-rw-r--r--xbmc/video/ContextMenus.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/xbmc/pvr/PVRContextMenus.cpp b/xbmc/pvr/PVRContextMenus.cpp
index ff211b12ec..2cbf58b43d 100644
--- a/xbmc/pvr/PVRContextMenus.cpp
+++ b/xbmc/pvr/PVRContextMenus.cpp
@@ -410,7 +410,7 @@ namespace PVR
bool DeleteWatchedRecordings::IsVisible(const CFileItem& item) const
{
// recordings folder?
- if (item.m_bIsFolder)
+ if (item.m_bIsFolder && !item.IsParentFolder())
return CPVRRecordingsPath(item.GetPath()).IsValid();
return false;
diff --git a/xbmc/video/ContextMenus.cpp b/xbmc/video/ContextMenus.cpp
index c7097b6333..c0de0360bc 100644
--- a/xbmc/video/ContextMenus.cpp
+++ b/xbmc/video/ContextMenus.cpp
@@ -71,7 +71,7 @@ bool CMarkWatched::IsVisible(const CFileItem& item) const
else if (item.GetProperty("IsVideoFolder").asBoolean())
return true;
else
- return URIUtils::IsPVRRecordingFileOrFolder(item.GetPath());
+ return !item.IsParentFolder() && URIUtils::IsPVRRecordingFileOrFolder(item.GetPath());
}
else if (!item.HasVideoInfoTag())
return false;
@@ -97,7 +97,7 @@ bool CMarkUnWatched::IsVisible(const CFileItem& item) const
else if (item.GetProperty("IsVideoFolder").asBoolean())
return true;
else
- return URIUtils::IsPVRRecordingFileOrFolder(item.GetPath());
+ return !item.IsParentFolder() && URIUtils::IsPVRRecordingFileOrFolder(item.GetPath());
}
else if (!item.HasVideoInfoTag())
return false;
@@ -234,7 +234,8 @@ void PlayAndQueueRecordings(const std::shared_ptr<CFileItem>& item, int windowId
bool IsActiveRecordingsFolder(const CFileItem& item)
{
- if (item.m_bIsFolder && StringUtils::StartsWith(item.GetPath(), "pvr://recordings/"))
+ if (item.m_bIsFolder && !item.IsParentFolder() &&
+ URIUtils::IsPVRRecordingFileOrFolder(item.GetPath()))
{
// Note: Recordings contained in the folder must be sorted properly, thus this
// item is only available if one of the recordings windows is active.