Rewrite server: FastAPI + auth (users/roles/tokens) + admin WebUI + server-authoritative covers/metadata

This commit is contained in:
2026-09-14 19:40:58 -04:00
parent 14b0b955f5
commit 7b7d31bdfa
26 changed files with 1528 additions and 18 deletions
+14 -1
View File
@@ -19,7 +19,7 @@ import urllib.request
import zipfile
from pathlib import Path
from . import config, sources
from . import config, server_client, sources
from .db import get_connection
log = logging.getLogger("covers")
@@ -1220,6 +1220,19 @@ def fetch_cover(name, release_id, system, timeout=10, quick=False):
except OSError:
pass
# Server is authoritative for covers when configured — no libretro/IGDB
# fallback; if the server is unreachable the cover just stays empty.
if server_client.configured():
try:
data = server_client.fetch_cover(system, name)
except Exception as exc: # noqa: BLE001
log.warning("server cover fetch failed for %r: %s", name, exc)
return None
if data is not None and _is_image(data):
_write_atomic(dest, data)
return dest
return None
key = str(release_id)
# In-memory + persistent negative caches: skip the network for recent misses.
last = _neg_cache.get(key)