diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2020-10-02 23:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 23:25:53 +0200 |
commit | 2d993a1e09427653dec6f2a7ab8972292a3e49e2 (patch) | |
tree | 6aaebad2417daa6f3145df492b7d47fa479a7388 | |
parent | 9b6a800f6940ef68c9c216678fc2c8d3e0435c35 (diff) | |
parent | 6dbd18b8a946c52fa61e6653bc58364bdc4d357b (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.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/ContextMenus.cpp | 7 |
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. |