diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2024-02-11 13:13:48 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-11 13:13:48 +1000 |
commit | 6a2d50891ee044f8c18d78141b7e1ef82ae246c4 (patch) | |
tree | e42511d303bd77d03403bda8dc5e6c282cff91a5 | |
parent | df86cfdc38428fdfe444e8a4197e5ba5fb24ab1c (diff) | |
parent | c2b48d7f0c9991a49be86e01cf35920775ac2080 (diff) |
Merge pull request #24446 from 78andyp/master_lock_fixes
[CGUIPassword] Media served through plugins is not shown when there is a master lock.
-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); |