Skip to content

Commit 89b6775

Browse files
committed
Attempting to fix a fluidd webcam config bug.
1 parent f83e138 commit 89b6775

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

moonraker_octoeverywhere/moonrakerwebcamhelper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,17 @@ def _TryToFindWebcamFromFluiddCustomDb(self) -> bool:
483483
if self.Logger.isEnabledFor(logging.DEBUG):
484484
self.Logger.debug("Returned FLUIDD webcam database data: %s", json.dumps(res, indent=4, separators=(", ", ": ")))
485485

486-
value = res["value"]
487-
if len(value) == 0:
486+
# In older versions, value is a list with the camera objects.
487+
# In newer versions, value is an object with a "cameras" list that holds the camera objects.
488+
cameras = res["value"]
489+
cameras = cameras.get("cameras", cameras)
490+
if len(cameras) == 0:
488491
return False
489492

490493
# Parse everything we got back.
491494
webcamSettingItems:List[WebcamSettingItem] = []
492-
for guid in value:
493-
webcamSettingsObj = value[guid]
495+
for guid in cameras:
496+
webcamSettingsObj = cameras[guid]
494497
webcamSettings = self._TryToParseFluiddCustomWebcamDbEntry(webcamSettingsObj)
495498
if webcamSettings is not None:
496499
webcamSettingItems.append(webcamSettings)

0 commit comments

Comments
 (0)