refactor: reorganize tracker utility functions and add settings management

This commit is contained in:
Vxrtrauter
2025-10-09 14:45:12 +02:00
parent 70035cc255
commit 1b0a00068c
3 changed files with 23 additions and 21 deletions
+20
View File
@@ -0,0 +1,20 @@
from core.network.aria2_integration import set_threads
def restart_aria2c(aria2process):
import main # had to do this because of circle import :(
import signal
import atexit
main.kill_aria2server(aria2process)
aria2process.wait()
aria2process = main.run_aria2server()
signal.signal(signal.SIGINT, main.keyboardinterrupthandler)
atexit.unregister(main.kill_aria2server)
atexit.register(main.kill_aria2server, aria2process)
def save_settings(thread_count, close, apiurl, aria2process):
global api_url
set_threads(thread_count)
api_url = apiurl
restart_aria2c(aria2process)
close()