🐛 Fix settings.webcam on first run
And make sure it's always available, albeit empty without permissions.
This commit is contained in:
1 parent
b416ff9766
commit
5fd8ea61e6
1 file changed
+6
-1
@@ -340,7 +340,10 @@ def getSettings():
|
||||
if len(plugin_settings):
|
||||
data["plugins"] = plugin_settings
|
||||
|
||||
if Permissions.WEBCAM.can() is True:
|
||||
if Permissions.WEBCAM.can() or (
|
||||
settings().getBoolean(["server", "firstRun"])
|
||||
and not userManager.has_been_customized()
|
||||
):
|
||||
webcamsDict = get_webcams_as_dicts()
|
||||
data["webcam"] = {
|
||||
"webcamEnabled": s.getBoolean(["webcam", "webcamEnabled"]),
|
||||
@@ -393,6 +396,8 @@ def getSettings():
|
||||
"snapshotWebcam": snapshotWebcam.config.name,
|
||||
}
|
||||
)
|
||||
else:
|
||||
data["webcam"] = {}
|
||||
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user