Skip to content

Add further robustness if TIDAL or Discord processes close, and recovery from that#4

Open
SkebbZ wants to merge 27 commits into
AeJae:mainfrom
SkebbZ:main
Open

Add further robustness if TIDAL or Discord processes close, and recovery from that#4
SkebbZ wants to merge 27 commits into
AeJae:mainfrom
SkebbZ:main

Conversation

@SkebbZ

@SkebbZ SkebbZ commented Aug 12, 2024

Copy link
Copy Markdown
Contributor
  1. Moved some stuff to functions, like:
  • updating RPC
  • sending the paused status
  • and quitting with KeyboardInterrupt
  1. Renamed disc_found variable to discord_connected, to differentiate from a new variable:
  2. discord_alive, to be used when the Discord app is closed or restarted:
  3. Added function to check if Discord is running, and recover the script if Discord is opened again - otherwise sleep
  4. Added function to check if TIDAL is running, and recover the script if it is opened again - otherwise sleep
  5. new variable to hold the TIDAL process state, tidal_alive
  6. Merged your earlier InvalidID changes manually (I think, didn't notice it before i started messing with it locally)

Got this working on startup minimized to system tray with AHK, and now it works rather well with me opening and closing stuff during the day :) I'm sure it could also be done with pythonw.exe and a bat file.

SkebbZ added 27 commits August 12, 2024 17:12
Added more robustness, script can now handle user closing either TIDAL or Discord and will then sleep until both are back.
Optional AHK script that can be compiled into an EXE and added to OS startup, hiding in the system tray.
Attempt to add more robustness and isolate an issue
fixed the bug when reconnecting and TIDAL is not playing
commented out debug stuff
cleanup redundant stuff and move the manual RPC.close() calls to the quit() function
Optional GUI variant
avoid infinite scroll, add clear GUI at the end of the main loop at least
add system tray icon with TIDAL logo overlapped by small Discord logo
added GUI info
clarified that AHK method can be used for both CLI and GUI
small info about CLI AHK variant autohiding on launch
minor cleaning and comment out some debug prints. flipped initial value of tidal_paused variable to fix some misleading print outputs
minor cosmetic changes to right click menu in system tray
minor tweaks and removed unneccessary prints like in the CLI version
efficiency updates, now uses less CPU and should almost never hit an exception outside of RPC.connect()
efficiency and logic changes, same as the CLI version to reduce CPU use and rely less on exceptions
added sleep(1) to quit function so it can be read by user before terminating if running from .bat without pause command
fixed missing indentation
comment debug prints
comment debug prints
Can be in the "icon" path in the AHK script to give the script or compiled app an icon in the system tray
Refactor Tidal RPC script to improve code clarity and performance. Updated comments for better understanding and changed tidal_pids from list to set for faster membership testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant