diff options
author | 78andyp <drandypowell@live.co.uk> | 2024-01-07 00:41:35 +0000 |
---|---|---|
committer | 78andyp <drandypowell@live.co.uk> | 2024-01-07 00:41:35 +0000 |
commit | c2b48d7f0c9991a49be86e01cf35920775ac2080 (patch) | |
tree | d6ac261c595c428b21421ce5933f0aa02928da09 | |
parent | 29da457ce6a3b0e5237adbc2a3f8e87c7d95bff6 (diff) |
[CGUIPassword] Media served through plugins is not shown when there is a master password
-rw-r--r-- | xbmc/GUIPassword.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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); |