Enrich's summary stops reporting a negative count
"136 entries (136 added/refreshed this run; -11 already present or waiting)" — local library entries were counted in the same tally as API fetches, but they have no API target, so the remainder went negative once eleven off-BGG games existed. The two populations are now counted and named separately, and zero-valued clauses are omitted: "136 entries (0 fetched from BGG; 11 local-only; 125 already present or waiting)." 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
b5e13be335
commit
2e1693c0be
+10
-3
@@ -122,7 +122,6 @@ def run_enrich(
|
||||
else [],
|
||||
"source_photos": [p for p in row["source_photos"].split(";") if p],
|
||||
}
|
||||
updated += 1
|
||||
|
||||
# prune keys no current target claims: a row whose version was approved
|
||||
# after a bare-key run (or was later rejected) must not leave an orphan
|
||||
@@ -143,10 +142,18 @@ def run_enrich(
|
||||
games_path, json.dumps(games, indent=2, ensure_ascii=False) + "\n"
|
||||
)
|
||||
|
||||
# count the two populations separately: local entries are built from
|
||||
# photo reads and have no target, so folding them into the API tally
|
||||
# made "already present or waiting" go negative
|
||||
waiting = len(targets) - updated
|
||||
parts = [f"{updated} fetched from BGG"]
|
||||
if local_keys:
|
||||
parts.append(f"{len(local_keys)} local-only")
|
||||
if waiting:
|
||||
parts.append(f"{waiting} already present or waiting")
|
||||
typer.echo(
|
||||
f"games.json: {len(games)} entr{'y' if len(games) == 1 else 'ies'} "
|
||||
f"({updated} added/refreshed this run; "
|
||||
f"{len(targets) - updated} already present or waiting)."
|
||||
f"({'; '.join(parts)})."
|
||||
)
|
||||
if blocked:
|
||||
remaining = [i for i in need if i not in fetched]
|
||||
|
||||
Reference in New Issue
Block a user