This commit is contained in:
2025-12-03 09:30:32 +00:00
parent d5169fbec7
commit 85b1562a75
4 changed files with 23 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ class DownloadManager:
return task
def get_queue(self):
return list(self.active_downloads.values()) + self.history
return list(self.active_downloads.values()) + self.history[-10:]
def _worker(self):
while True:

View File

@@ -27,7 +27,26 @@ class TidalWrapper:
self.auth_status = {"status": "idle", "message": "", "link": "", "code": ""}
def is_authenticated(self) -> bool:
return self.session.check_login()
max_retries = 5
retry_delay = 5
for attempt in range(max_retries):
try:
return self.session.check_login()
except Exception as e:
error_str = str(e)
# Check for connection-related errors
if "Connection" in error_str or "RemoteDisconnected" in error_str or "Network" in error_str:
logger.warning(f"Connection error checking authentication (Attempt {attempt + 1}/{max_retries}): {e}")
if attempt < max_retries - 1:
logger.info(f"Waiting {retry_delay} seconds for network/gluetun to recover...")
time.sleep(retry_delay)
continue
# If it's not a connection error, or we've run out of retries
logger.error(f"Error checking authentication status: {e}")
return False
return False
def start_device_login(self) -> Dict[str, str]:
"""