feat: link DLC and soundtracks to parent games
CI / test (push) Successful in 32s

Add games.parent_appid (schema v9), parse appinfo parent links, show addons and parent game in the card, and add import_steam.py --refresh-parents for existing databases.
This commit is contained in:
strsv committed 2026-11-07 01:36:26 +03:00
1 parent 376a2ee7a0
commit 528fcb7474
18 files changed
+135 -11

No files matched your search

+17
View File
@@ -1300,6 +1300,7 @@ class Handler(BaseHTTPRequestHandler):
try:
r = con.execute("""
SELECT g.appid, g.name, g.type, g.release_date, g.metacritic, g.review_pct,
g.parent_appid,
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,
@@ -1331,6 +1332,22 @@ class Handler(BaseHTTPRequestHandler):
"SELECT key, value FROM attributes WHERE appid=? ORDER BY key", (appid,))]
item["attributes"] = attrs
item["similar"] = reco.similar_games(con, appid, limit=6)
item["addons"] = [
{"appid": row["appid"], "name": row["name"], "type": row["type"]}
for row in con.execute(
"""SELECT appid, name, type FROM games
WHERE parent_appid = ? ORDER BY type, name""", (appid,))
]
item["parent"] = None
if r["parent_appid"]:
parent = con.execute(
"SELECT appid, name, type FROM games WHERE appid = ?",
(r["parent_appid"],)).fetchone()
if parent:
item["parent"] = {
"appid": parent["appid"], "name": parent["name"],
"type": parent["type"],
}
self._json(item)
finally:
con.close()