diff --git a/actions/RecPlayPause/RecPlayPause.py b/actions/RecPlayPause/RecPlayPause.py index b8c18df..7ce2d03 100644 --- a/actions/RecPlayPause/RecPlayPause.py +++ b/actions/RecPlayPause/RecPlayPause.py @@ -13,9 +13,10 @@ class RecPlayPause(OBSActionBase): def on_ready(self): # Connect to obs if not connected - if not self.plugin_base.backend.get_connected(): - # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) - self.reconnect_obs() + if self.plugin_base.backend is not None: + if not self.plugin_base.backend.get_connected(): + # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) + self.reconnect_obs() # Show current rec status self.show_current_rec_status() diff --git a/actions/SwitchScene/SwitchScene.py b/actions/SwitchScene/SwitchScene.py index 5f1b0e8..7a4e2bb 100644 --- a/actions/SwitchScene/SwitchScene.py +++ b/actions/SwitchScene/SwitchScene.py @@ -20,8 +20,9 @@ class SwitchScene(OBSActionBase): def on_ready(self): # Connect to obs if not connected - if not self.plugin_base.backend.get_connected(): # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) - self.reconnect_obs() + if self.plugin_base.backend is not None: + if not self.plugin_base.backend.get_connected(): # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) + self.reconnect_obs() media_path = os.path.join(self.plugin_base.PATH, "assets", "transition_slide.png") self.set_media(media_path=media_path, size=0.75) diff --git a/actions/ToggleRecord/ToggleRecord.py b/actions/ToggleRecord/ToggleRecord.py index 71dfc4a..e94a45b 100644 --- a/actions/ToggleRecord/ToggleRecord.py +++ b/actions/ToggleRecord/ToggleRecord.py @@ -14,8 +14,9 @@ class ToggleRecord(OBSActionBase): def on_ready(self): # Connect to obs if not connected - if not self.plugin_base.backend.get_connected(): # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) - self.reconnect_obs() + if self.plugin_base.backend is not None: + if not self.plugin_base.backend.get_connected(): # self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False) + self.reconnect_obs() # Show current rec status self.show_current_rec_status()