Fix: RecPlayPause not setting initial icon
This commit is contained in:
parent
62ed7318a6
commit
a9dcc5b28e
|
@ -11,6 +11,7 @@ class RecPlayPause(OBSActionBase):
|
||||||
self.current_state = -1
|
self.current_state = -1
|
||||||
|
|
||||||
def on_ready(self):
|
def on_ready(self):
|
||||||
|
self.current_state = -1
|
||||||
# Connect to obs if not connected
|
# Connect to obs if not connected
|
||||||
if self.plugin_base.backend is not None:
|
if self.plugin_base.backend is not None:
|
||||||
if not self.plugin_base.get_connected():
|
if not self.plugin_base.get_connected():
|
||||||
|
@ -22,11 +23,11 @@ class RecPlayPause(OBSActionBase):
|
||||||
|
|
||||||
def show_current_rec_status(self, new_paused = False):
|
def show_current_rec_status(self, new_paused = False):
|
||||||
if not self.plugin_base.get_connected():
|
if not self.plugin_base.get_connected():
|
||||||
self.set_media(media_path=os.path.join(self.plugin_base.PATH, "assets", "error.png"))
|
self.show_error()
|
||||||
return
|
return
|
||||||
status = self.plugin_base.backend.get_record_status()
|
status = self.plugin_base.backend.get_record_status()
|
||||||
if status is None:
|
if status is None:
|
||||||
self.set_media(media_path=os.path.join(self.plugin_base.PATH, "assets", "error.png"))
|
self.show_error()
|
||||||
return
|
return
|
||||||
if status["active"] and not status["paused"]:
|
if status["active"] and not status["paused"]:
|
||||||
self.show_for_state(1)
|
self.show_for_state(1)
|
||||||
|
@ -42,6 +43,7 @@ class RecPlayPause(OBSActionBase):
|
||||||
2: Paused
|
2: Paused
|
||||||
3: Stopping in progress
|
3: Stopping in progress
|
||||||
"""
|
"""
|
||||||
|
self.hide_error()
|
||||||
if state == self.current_state:
|
if state == self.current_state:
|
||||||
return
|
return
|
||||||
self.current_state = state
|
self.current_state = state
|
||||||
|
|
Loading…
Reference in New Issue