Update IP/Port, build script

This commit is contained in:
oitsjustjose 2025-06-18 22:03:39 -05:00
commit 45f33546d4
3 changed files with 6 additions and 13 deletions

View file

@ -1,4 +1,4 @@
```bat
pip install nuitka
python -m nuitka --onefile --windows-disable-console --standalone .\src\desktop\tidbyt-desktop-companion.py
python -m nuitka --onefile --windows-console-mode=disable --standalone .\src\desktop\tidbyt-desktop-companion.py
```

View file

@ -6,16 +6,13 @@ from src.common.appstate import AppState
def on_event(event):
state: AppState = AppState.IDLE
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.6:8000")
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.3:8624")
if event == obspython.OBS_FRONTEND_EVENT_RECORDING_STARTED:
state = AppState.OBS_RECORDING
elif event == obspython.OBS_FRONTEND_EVENT_STREAMING_STARTED:
state = AppState.OBS_STREAMING
elif (
event == obspython.OBS_FRONTEND_EVENT_RECORDING_STOPPED
or event == obspython.OBS_FRONTEND_EVENT_STREAMING_STOPPED
):
elif event == obspython.OBS_FRONTEND_EVENT_RECORDING_STOPPED or event == obspython.OBS_FRONTEND_EVENT_STREAMING_STOPPED:
state = AppState.OBS_PAUSED
urllib.request.urlopen(f"{backend_uri}?new_state={state.value}", data={})
@ -26,6 +23,6 @@ def script_load(_):
def script_unload():
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.6:8000")
backend_uri = getenv("TIDBYT_SERVER_URI", "http://172.16.1.3:8624")
urllib.request.urlopen(f"{backend_uri}?new_state={AppState.IDLE.value}", data={})

View file

@ -104,17 +104,13 @@ class Main:
"""
win_title = win32gui.GetWindowText(hwnd)
matches: List[MeetingWindow] = list(
filter(lambda x: x.matches_title(win_title), self.__meeting_windows)
)
matches: List[MeetingWindow] = list(filter(lambda x: x.matches_title(win_title), self.__meeting_windows))
if not matches:
return True
_, pid = win32process.GetWindowThreadProcessId(hwnd)
rows = self.__wmi.query(
f"SELECT Name FROM Win32_Process WHERE ProcessId = {pid}"
)
rows = self.__wmi.query(f"SELECT Name FROM Win32_Process WHERE ProcessId = {pid}")
if not any([x.matches_executable(y.Name) for x in matches for y in rows]):
return True