Same-title copies become tellable apart; wrong autos become fixable
Three split Wiz-Wars meant three identical "Wiz-War" edition cards — version cards now carry their copy's photo thumbnails and name the source photo in the prompt, so each ballot says which box it's about. And the .dungeon-class failure gets its escape hatch: "wrong match" on any matched Titles row clears the match and returns the title to Review's unmatched queue, where re-search and manual-id already live. Help notes the BGG wrinkle that makes this matter for Wiz-War specifically: early editions and the FFG remake are SEPARATE games, so a copy whose edition isn't on the ballot belongs to the sibling entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
co-authored by
Claude Fable 5
parent
42ef34c3a7
commit
c5daad023d
@@ -1160,3 +1160,45 @@ def test_add_title_by_hand(tmp_path):
|
||||
web.post("/api/add-title", json={"title": "X", "year": "199Y"}).status_code
|
||||
== 400
|
||||
)
|
||||
|
||||
|
||||
def test_wrong_match_reopens_for_research(tmp_path):
|
||||
cfg = make_cfg(tmp_path)
|
||||
rows = read_matches(cfg.matches_path)
|
||||
rows.append(
|
||||
_row(
|
||||
title_raw="Dungeon!",
|
||||
match_status="auto",
|
||||
bgg_id="345770",
|
||||
bgg_name=".dungeon",
|
||||
version_status="version_unknown",
|
||||
)
|
||||
)
|
||||
write_matches(cfg.matches_path, rows)
|
||||
web = TestClient(create_app(cfg, client=unauthorized_client(tmp_path)))
|
||||
res = web.post(
|
||||
"/api/reopen-match",
|
||||
json={"title_raw": "Dungeon!", "source_photos": "shelf.jpg"},
|
||||
)
|
||||
assert res.status_code == 200
|
||||
saved = {r["title_raw"]: r for r in read_matches(cfg.matches_path)}
|
||||
assert saved["Dungeon!"]["match_status"] == "unmatched"
|
||||
assert saved["Dungeon!"]["bgg_id"] == ""
|
||||
assert saved["Dungeon!"]["version_candidates_json"] == "[]"
|
||||
# it's back in the review queue
|
||||
assert any(p["title_raw"] == "Dungeon!" for p in res.json()["pending"])
|
||||
# an unmatched row can't be "reopened"
|
||||
assert (
|
||||
web.post(
|
||||
"/api/reopen-match",
|
||||
json={"title_raw": "Mystery", "source_photos": "shelf.jpg"},
|
||||
).status_code
|
||||
== 400
|
||||
)
|
||||
|
||||
|
||||
def test_version_cards_carry_their_photos(tmp_path):
|
||||
web, _ = make_client(tmp_path)
|
||||
(card,) = web.get("/api/state").json()["versions"]
|
||||
assert card["title_raw"] == "Dungeon!"
|
||||
assert card["photos"] == ["shelf.jpg"] # same-title copies stay tellable
|
||||
|
||||
Reference in New Issue
Block a user