move auth timeout to settings

This commit is contained in:
2025-12-10 01:48:08 +01:00
parent ef4e4c43ae
commit dc94bb8ba5
2 changed files with 2 additions and 3 deletions

View File

@@ -7,8 +7,6 @@ import logging
import time
import os
AUTH_TIMEOUT = 10 * 60 # 10 minutes
class JellyfinApiClient:
def __init__(self):
machine_name = os.uname().nodename
@@ -38,7 +36,7 @@ class JellyfinApiClient:
self.logger.info("Authenticated with Jellyfin server.")
def get_current_playback(self) -> JellyfinMediaItem | None:
if time.time() - self.last_auth_time > AUTH_TIMEOUT:
if time.time() - self.last_auth_time > settings.jellyfin_auth_timeout:
self.authenticate()
self.logger.info("Fetching current playback information...")