mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 11:58:53 -06:00
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:
1 parent
398782a5cd
commit
1b7d30967b
9 files changed
+171
-19
No files matched your search
@@ -117,7 +117,10 @@ SLUG_MAP: dict[str, str] = {
|
||||
}
|
||||
```
|
||||
|
||||
Warn on unmapped slugs so new systems are surfaced during scraping.
|
||||
An unmapped slug fails the scrape: skipped, its files would leave the platform
|
||||
file while the run still exits 0. An entry the platform file cannot carry goes
|
||||
in `self.dropped` with its reason, and `check_freshness.py` reports the
|
||||
platform UNKNOWN while one is left out.
|
||||
|
||||
### generate_platform_yaml (optional)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user