MCPcopy
hub / github.com/xlenore/psx-covers / collect_expected_codes

Function collect_expected_codes

tools/update_stats.py:15–28  ·  view source on GitHub ↗
(gamedb)

Source from the content-addressed store, hash-verified

13
14
15def collect_expected_codes(gamedb):
16 by_prefix = defaultdict(set)
17 for game in gamedb:
18 for code in game.get('codes', []):
19 if not code:
20 continue
21 code = code.strip()
22 m = re.match(r'^([A-Za-z0-9]+)-', code)
23 if m:
24 prefix = m.group(1).upper()
25 else:
26 prefix = code.upper()
27 by_prefix[prefix].add(code.upper())
28 return by_prefix
29
30
31def load_cover_names(covers_dir: Path):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected