RPGs become local library citizens: identified, enriched, never uploaded
When the board-game search (and truncation heads) runs dry, resolve falls back to type=rpgitem — the geekdo database is shared, so the same API, token, cache, and classification machinery apply. Matched rpgitems flow through review and enrich normally but diff routes them to a local_only bucket, structurally outside to_add/to_update: their collections live on RPGGeek, beyond this pipeline's write scope. The library page gains an All/Board games/RPGs filter and an "RPG · local only" badge; the catalog tags them too. Fixture generators write blanket empty rpgitem stubs for every known query (the fallback fires for every unmatched title) with real synthetic entries for Alice Is Missing. Data: both Alice rows re-resolved from unmatched to auto rpgitem matches. First diff since the audit reworks also lands their real-data consequences: Dungeon! gains its TSR edition update on a versionless copy the old claim ordering missed, to_add rows carry unioned reshoot provenance, and the Herbaceous typo row's survivor is now the correctly-spelled title. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,19 @@ SEARCHES: dict[str, list[tuple]] = {
|
||||
"ALICE IS": [],
|
||||
}
|
||||
|
||||
# rpgitem-search results for titles that live on RPGGeek, not BGG. Ids are
|
||||
# SYNTHETIC like everything else here; the marker guards them. Queries not
|
||||
# listed get an empty rpgitem stub automatically.
|
||||
RPG = "rpgitem"
|
||||
RPG_SEARCHES: dict[str, list[tuple]] = {
|
||||
"ALICE IS MISSING: A SILENT ROLE PLAYING GAME": [
|
||||
(400001, "Alice Is Missing: A Silent Role Playing Game", 2020, RPG, "primary")
|
||||
],
|
||||
"ALICE IS MISSING: SILENT FALLS EXPANSION": [
|
||||
(400002, "Alice Is Missing: Silent Falls Expansion", 2023, RPG, "primary")
|
||||
],
|
||||
}
|
||||
|
||||
# ids-param -> [(bgg_id, name, year, type, owned, rank, [publishers])]
|
||||
THING_STATS: dict[str, list[tuple]] = {
|
||||
"39,40529": [
|
||||
@@ -144,6 +157,8 @@ THING_STATS: dict[str, list[tuple]] = {
|
||||
|
||||
# bgg_id -> [(version_id, name, year, [publishers], [languages])]
|
||||
VERSIONS: dict[int, list[tuple]] = {
|
||||
400001: [], # Alice Is Missing (rpgitem): no cataloged versions in stubs
|
||||
400002: [],
|
||||
235096: [(360982, "English edition", 2017, ["ThinkFun"], ["English"])],
|
||||
240: [
|
||||
(
|
||||
@@ -344,6 +359,8 @@ def main() -> None:
|
||||
for query, results in SEARCHES.items():
|
||||
key = cache_key("search", {"query": query, "type": SEARCH_TYPES})
|
||||
files[key] = search_xml(results)
|
||||
rpg_key = cache_key("search", {"query": query, "type": "rpgitem"})
|
||||
files[rpg_key] = search_xml(RPG_SEARCHES.get(query, []))
|
||||
for ids, things in THING_STATS.items():
|
||||
files[cache_key("thing", {"id": ids, "stats": "1"})] = stats_xml(things)
|
||||
for bgg_id, versions in VERSIONS.items():
|
||||
|
||||
@@ -106,6 +106,10 @@ def main() -> None:
|
||||
key = cache_key("search", {"query": query, "type": SEARCH_TYPES})
|
||||
total = items.count("<item ")
|
||||
(FIXTURE_CACHE / key).write_text(f'<items total="{total}">{items}</items>')
|
||||
# resolve falls back to an rpgitem search whenever the board-game
|
||||
# search runs dry: every known query needs an (empty) answer there
|
||||
rpg_key = cache_key("search", {"query": query, "type": "rpgitem"})
|
||||
(FIXTURE_CACHE / rpg_key).write_text('<items total="0"></items>')
|
||||
for (ids, flavor), xml in THINGS.items():
|
||||
key = cache_key("thing", {"id": ids, flavor: "1"})
|
||||
(FIXTURE_CACHE / key).write_text(xml)
|
||||
|
||||
Reference in New Issue
Block a user