2 Commits
Author SHA1 Message Date
strsv 1fcd0bd2af docs: refresh UI screenshots
CI / test (push) Successful in 28s
2026-11-09 09:51:32 +03:00
strsv dad2e768c1 feat: include localized genres and tags in snapshot
CI / test (push) Successful in 28s
2026-11-09 09:25:06 +03:00
11 changed files with 18 additions and 6 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 KiB

After

Width:  |  Height:  |  Size: 603 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 767 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 KiB

After

Width:  |  Height:  |  Size: 585 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 66 KiB

+2
View File
@@ -93,6 +93,8 @@ class ExportSnapshotTests(unittest.TestCase):
by_id = {item["appid"]: item for item in catalog}
self.assertEqual(by_id[1]["tags"], ["RPG", "Story Rich"])
self.assertEqual(by_id[1]["genres"], ["Adventure", "RPG"])
self.assertEqual(by_id[1]["genres_ru"], ["Приключенческие игры", "Ролевые игры"])
self.assertEqual(len(by_id[1]["tags_ru"]), len(by_id[1]["tags"]))
self.assertEqual(by_id[1]["details"]["developers"], "Dev")
self.assertEqual(by_id[1]["translation"]["lang"], "ru")
self.assertEqual(by_id[1]["hltb"]["main"], 10.0)
+16 -6
View File
@@ -71,20 +71,28 @@ def _load_json(value, fallback):
def _game_tags(con):
tags = {}
tags_ru = {}
for row in con.execute("""
SELECT gt.appid, tn.name
SELECT gt.appid, tn.name, COALESCE(tn.name_ru, '') AS name_ru
FROM game_tags gt JOIN tag_names tn ON tn.tag_id = gt.tag_id
ORDER BY gt.appid, tn.name
"""):
tags.setdefault(row["appid"], []).append(row["name"])
return tags
tags_ru.setdefault(row["appid"], []).append(row["name_ru"] or "")
return tags, tags_ru
def _game_genres(con):
genres = {}
for row in con.execute("SELECT appid, genre FROM game_genres ORDER BY appid, genre"):
genres_ru = {}
for row in con.execute("""
SELECT gg.appid, gg.genre, COALESCE(gn.name_ru, '') AS name_ru
FROM game_genres gg LEFT JOIN genre_names gn ON gn.name = gg.genre
ORDER BY gg.appid, gg.genre
"""):
genres.setdefault(row["appid"], []).append(row["genre"])
return genres
genres_ru.setdefault(row["appid"], []).append(row["name_ru"] or "")
return genres, genres_ru
def _details_map(con):
@@ -104,8 +112,8 @@ def collect(con, handle=None, steamid=None, notes=True, translations=True,
row = con.execute("SELECT value FROM schema_meta WHERE key = 'steamid'").fetchone()
steamid = (steamid or (row[0] if row else "") or "").strip()
tags = _game_tags(con)
genres = _game_genres(con)
tags, tags_ru = _game_tags(con)
genres, genres_ru = _game_genres(con)
details = _details_map(con)
translations = _translations_map(con) if translations else {}
@@ -126,6 +134,8 @@ def collect(con, handle=None, steamid=None, notes=True, translations=True,
"parent_appid": game["parent_appid"],
"genres": genres.get(appid, []),
"tags": tags.get(appid, []),
"genres_ru": genres_ru.get(appid, []),
"tags_ru": tags_ru.get(appid, []),
}
detail = details.get(appid)
if detail: