add http to camera address if not found

This commit is contained in:
Prohurtz 2023-03-18 19:04:30 -05:00
parent 65f6aa7181
commit 5ea1a39209
2 changed files with 7 additions and 1 deletions

View File

@ -50,6 +50,9 @@ class Camera:
if (
self.config.capture_source != None and self.config.capture_source != ""
):
# if len(self.current_capture_source) > 2 and "http" not in self.current_capture_source:
# self.current_capture_source = f"http://{self.current_capture_source}/"
# print(self.current_capture_source)
if (self.current_capture_source[:3] == "COM"):
if (
self.serial_connection is None

View File

@ -192,7 +192,10 @@ class CameraWidget:
if values[self.gui_camera_addr] == "":
self.config.capture_source = None
else:
self.config.capture_source = values[self.gui_camera_addr]
if len(values[self.gui_camera_addr]) > 5 and "http" not in values[self.gui_camera_addr]: # If http is not in camera address, add it.
self.config.capture_source = f"http://{values[self.gui_camera_addr]}/"
else:
self.config.capture_source = values[self.gui_camera_addr]
changed = True