From c2b48d7f0c9991a49be86e01cf35920775ac2080 Mon Sep 17 00:00:00 2001 From: 78andyp Date: Sun, 7 Jan 2024 00:41:35 +0000 Subject: [CGUIPassword] Media served through plugins is not shown when there is a master password --- xbmc/GUIPassword.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp index eaaa042a67..2a0d5ec38e 100644 --- a/xbmc/GUIPassword.cpp +++ b/xbmc/GUIPassword.cpp @@ -11,6 +11,7 @@ #include "FileItem.h" #include "GUIUserMessages.h" #include "ServiceBroker.h" +#include "URL.h" #include "Util.h" #include "dialogs/GUIDialogGamepad.h" #include "dialogs/GUIDialogNumeric.h" @@ -544,6 +545,14 @@ bool CGUIPassword::IsDatabasePathUnlocked(const std::string& strPath, VECSOURCES if (g_passwordManager.bMasterUser || profileManager->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE) return true; + // Don't check plugin paths as they don't have an entry in sources.xml + // Base locked status on videos being locked and being in the video + // navigation screen (must have passed lock by then) + CURL url{strPath}; + if (url.IsProtocol("plugin")) + return !(profileManager->GetCurrentProfile().videoLocked() && + CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_VIDEO_NAV); + // try to find the best matching source bool bName = false; int iIndex = CUtil::GetMatchingSource(strPath, vecSources, bName); -- cgit v1.2.3