set timeout for directory command

initialise current_directory to empty value if the request fails.

patch bump
This commit is contained in:
onyx-and-iris 2025-06-30 06:17:05 +01:00
parent 6035e09e43
commit 8813c25819
3 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "simple-recorder"
version = "0.3.1"
version = "0.3.2"
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-")],