2 Commits

Author SHA1 Message Date
d0401d0457 add keyboard bindings for current+update buttons 2025-06-30 06:28:08 +01:00
8813c25819 set timeout for directory command
initialise current_directory to empty value if the request fails.

patch bump
2025-06-30 06:17:05 +01:00
3 changed files with 8 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
[project]
name = "simple-recorder"
version = "0.3.1"
version = "0.3.3"
description = "A simple OBS recorder"
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
dependencies = [

View File

@@ -21,7 +21,7 @@ class Directory(Command):
async def run(self):
try:
with obsws.ReqClient(
host=self.host, port=self.port, password=self.password
host=self.host, port=self.port, password=self.password, timeout=3
) as client:
if self.directory:
client.set_record_directory(self.directory)

View File

@@ -31,6 +31,7 @@ class SimpleRecorderWindow(fsg.Window):
current_directory = resp.record_directory
except (ConnectionRefusedError, TimeoutError):
status_message = "Failed to connect to OBS. Is it running?"
current_directory = ""
recorder_layout = [
[fsg.Text("Enter recording filename:", key="-PROMPT-")],
@@ -102,6 +103,9 @@ class SimpleRecorderWindow(fsg.Window):
self["Add Chapter"].bind("<Leave>", " || LEAVE")
self["Add Chapter"].bind("<Button-3>", " || RIGHT_CLICK")
self["-GET-CURRENT-"].bind("<Return>", " || RETURN")
self["-UPDATE-"].bind("<Return>", " || RETURN")
async def run(self):
while True:
event, values = self.read()
@@ -185,7 +189,7 @@ class SimpleRecorderWindow(fsg.Window):
"This feature is not implemented yet", text_color="orange"
)
case ["-GET-CURRENT-"]:
case ["-GET-CURRENT-"] | ["-GET-CURRENT-", "RETURN"]:
try:
current_directory = await Directory(
host=self.host, port=self.port, password=self.password
@@ -196,7 +200,7 @@ class SimpleRecorderWindow(fsg.Window):
f"Error: {e.raw_message}", text_color="red"
)
case ["-UPDATE-"]:
case ["-UPDATE-"] | ["-UPDATE-", "RETURN"]:
filepath = values["-FILEPATH-"]
if not filepath:
self["-OUTPUT-SETTINGS-"].update(