fix: surface upstream entries a scraper drops

RomM skipped an unmapped IGDB slug and RetroDECK a second component's
conflicting MD5 with a stderr warning only: the rescrape exited 0, the
rewritten file showed no diff and check_freshness said OK.

An unmapped slug now fails the RomM scrape. A deliberate drop goes in
BaseScraper.dropped, scraper_cli prints it under DROPPED_PREFIX, and the
freshness rescrape reports an otherwise unchanged platform UNKNOWN.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 19:50:10 +01:00
1 parent 398782a5cd
commit 1b7d30967b
9 files changed
+171 -19

No files matched your search

+4 -2
View File
@@ -140,7 +140,6 @@ Based on the RomM scraper pattern (JSON source, flat structure):
from __future__ import annotations
import json
import sys
try:
from .base_scraper import BaseScraper, BiosRequirement
@@ -168,10 +167,11 @@ class Scraper(BaseScraper):
data = json.loads(raw)
requirements = []
unmapped = set()
for entry in data:
system = SLUG_MAP.get(entry["platform"])
if not system:
print(f"Warning: unmapped '{entry['platform']}'", file=sys.stderr)
unmapped.add(entry["platform"])
continue
requirements.append(BiosRequirement(
name=entry["filename"],
@@ -182,6 +182,8 @@ class Scraper(BaseScraper):
destination=entry["filename"],
required=entry.get("required", True),
))
if unmapped:
raise ValueError(f"unmapped platform {', '.join(sorted(unmapped))}")
return requirements
def validate_format(self, raw_data: str) -> bool: