feat: add optional HLTB enrichment
CI / test (push) Successful in 7m10s

This commit is contained in:
strsv committed 2026-11-06 22:16:27 +03:00
1 parent b865a4a389
commit d07dec5e75
19 files changed
+258 -23

No files matched your search

+7 -2
View File
@@ -476,6 +476,11 @@ def serialize(r, tags, genres, details):
"metacritic": r["metacritic"],
"hours": round((r["minutes"] or 0) / 60, 1),
"duration": r["estimated_hours"],
"hltb": {
"main": r["hltb_main"] if "hltb_main" in r.keys() else None,
"extra": r["hltb_extra"] if "hltb_extra" in r.keys() else None,
"complete": r["hltb_complete"] if "hltb_complete" in r.keys() else None,
} if "hltb_main" in r.keys() and r["hltb_main"] else None,
"installed": bool(r["installed"]),
"status": r["status"],
"rating": r["rating"],
@@ -1006,7 +1011,7 @@ class Handler(BaseHTTPRequestHandler):
total = con.execute(f"SELECT COUNT(*) c {base}", params).fetchone()["c"]
rows = con.execute(
f""" SELECT g.appid, g.name, g.release_date, g.metacritic, g.review_pct,
g.estimated_hours,
g.estimated_hours, g.hltb_main, g.hltb_extra, g.hltb_complete,
COALESCE(p.minutes,0) minutes, COALESCE(i.installed,0) installed,
COALESCE(pe.status,'backlog') status, pe.rating,
COALESCE(pe.favorite,0) favorite, pe.notes
@@ -1104,7 +1109,7 @@ class Handler(BaseHTTPRequestHandler):
try:
r = con.execute("""
SELECT g.appid, g.name, g.type, g.release_date, g.metacritic, g.review_pct,
g.estimated_hours,
g.estimated_hours, g.hltb_main, g.hltb_extra, g.hltb_complete,
COALESCE(p.minutes,0) minutes, p.last_played,
COALESCE(i.installed,0) installed, i.size_bytes,
COALESCE(pe.status,'backlog') status, pe.rating,