Fix: Possible crash if backend needs too long to start
This commit is contained in:
parent
efb24e2f08
commit
4637027f89
|
@ -13,9 +13,10 @@ class RecPlayPause(OBSActionBase):
|
||||||
|
|
||||||
def on_ready(self):
|
def on_ready(self):
|
||||||
# Connect to obs if not connected
|
# Connect to obs if not connected
|
||||||
if not self.plugin_base.backend.get_connected():
|
if self.plugin_base.backend is not None:
|
||||||
# self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False)
|
if not self.plugin_base.backend.get_connected():
|
||||||
self.reconnect_obs()
|
# self.plugin_base.obs.connect_to(host="localhost", port=4444, timeout=3, legacy=False)
|
||||||
|
self.reconnect_obs()
|
||||||
|
|
||||||
# Show current rec status
|
# Show current rec status
|
||||||
self.show_current_rec_status()
|
self.show_current_rec_status()
|
||||||
|
|
|
@ -20,8 +20,9 @@ class SwitchScene(OBSActionBase):
|
||||||
|
|
||||||
def on_ready(self):
|
def on_ready(self):
|
||||||
# Connect to obs if not connected
|
# 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)
|
if self.plugin_base.backend is not None:
|
||||||
self.reconnect_obs()
|
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")
|
media_path = os.path.join(self.plugin_base.PATH, "assets", "transition_slide.png")
|
||||||
self.set_media(media_path=media_path, size=0.75)
|
self.set_media(media_path=media_path, size=0.75)
|
||||||
|
|
|
@ -14,8 +14,9 @@ class ToggleRecord(OBSActionBase):
|
||||||
|
|
||||||
def on_ready(self):
|
def on_ready(self):
|
||||||
# Connect to obs if not connected
|
# 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)
|
if self.plugin_base.backend is not None:
|
||||||
self.reconnect_obs()
|
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
|
# Show current rec status
|
||||||
self.show_current_rec_status()
|
self.show_current_rec_status()
|
||||||
|
|
Loading…
Reference in New Issue