Commit Graph
94 Commits
Author SHA1 Message Date
Abdessamad Derraz 88d7ca4814 fix: stop a retrodeck scrape on a failed fetch 2026-10-10 12:08:52 +02:00
Abdessamad Derraz e26ee44229 fix: export only what the platform declares 2026-10-10 11:15:25 +02:00
Abdessamad Derraz a00f57ad37 fix: write scraped files whole or not at all 2026-10-10 04:45:10 +02:00
Abdessamad Derraz a116743471 fix: scrape the mame release that labels the data 2026-10-10 04:40:27 +02:00
Abdessamad Derraz d8ad89902b refactor: split helpers out of grown functions 2026-10-06 13:59:50 +02:00
Abdessamad Derraz 8bf8fdba9e fix: refuse a libretro scrape without core info 2026-10-06 12:23:48 +02:00
Abdessamad Derraz 1e61b749cf fix: refuse an emudeck scrape with no cores 2026-10-06 12:23:48 +02:00
Abdessamad Derraz 0eecb23724 fix: refuse batocera targets with unread boards 2026-10-06 12:22:51 +02:00
Abdessamad Derraz 548ea5935b fix: stop a scrape whose release tag is unread 2026-10-06 12:22:51 +02:00
Abdessamad Derraz f3d01aeeeb refactor: split this round's fixes into small helpers 2026-10-06 11:16:06 +02:00
Abdessamad Derraz a70ff264d2 fix: refuse an unknown mame or fbneo version 2026-10-06 09:42:33 +02:00
Abdessamad Derraz 6b57377111 fix: name each retropie package once per target 2026-10-06 05:33:18 +02:00
Abdessamad Derraz 240a30f1d7 fix: read retropie targets the way retropie does 2026-10-06 05:22:34 +02:00
Abdessamad Derraz 29a285d37e fix: stop target scrapes on a failed request 2026-10-06 05:19:05 +02:00
Abdessamad Derraz 077351bab3 feat: list retrodeck standalone emulators 2026-10-06 01:43:30 +02:00
Abdessamad Derraz 6d6cd7d668 fix: map pc-8801, dsi and cd-i system slugs 2026-10-06 01:22:56 +02:00
Abdessamad Derraz 6453a96d47 feat: read retropie version from its setup script 2026-10-04 17:47:51 +02:00
Abdessamad Derraz 1a993edc0d feat: record upstream dat blobs in recipe snapshots 2026-10-04 16:35:59 +02:00
Abdessamad Derraz 887fc34bf6 feat: lay out standalone files by build mode 2026-10-04 16:35:59 +02:00
Abdessamad Derraz 3e6f30c697 fix: send github token to scraper api calls 2026-10-04 15:06:00 +02:00
Abdessamad Derraz 08ef1e8dcf fix: fail batocera target scraper on empty input 2026-10-04 14:36:32 +02:00
Abdessamad Derraz 691ccbfca7 feat: make the native export round-trip a platform file 2026-09-05 17:32:48 +02:00
Abdessamad Derraz 562e3fb20c feat: serve the pc engine cards to turbografx-cd 2026-09-03 17:51:34 +02:00
Abdessamad Derraz b86a34933c feat: parse gamel machines and computed sizes 2026-08-12 03:15:05 +02:00
Abdessamad Derraz b5f28d7b7f chore: drop three reads whose result went nowhere
The requirement parser read core, hashMatchMandatory and note from
each bios element and discarded all three, which reads like a dropped
attribute: hashMatchMandatory decides whether a wrong hash is yellow or
red on Recalbox. It is not lost -- the config parser below captures it
for the YAML -- so these were leftovers, and they cost a look to
confirm that.

Two yaml imports left unused by the move to the shared loader go too.
2026-08-11 20:27:53 +02:00
Abdessamad Derraz 3b8f2d75d5 perf: read yaml through the c loader
Loading the emulator profiles is the most expensive step of every
command here, and all forty call sites used the pure-Python scanner
while libyaml sat unused in the same wheel. One shared yaml_load picks
the C loader when pyyaml ships it: the 375 profiles parse in 0.18s
instead of 1.39s, and verify --platform retroarch drops from 2.17s to
0.73s. The loader class is the same restricted one safe_load uses.

es_bios.xml was parsed straight from the network while install.py
already refused a document declaring entities; both now share one
guard. Scrapers reach it through a single path bootstrap in the
package rather than two ad-hoc ones.
2026-08-11 00:55:16 +02:00
Abdessamad Derraz 77dff6377e fix: keep fbneo per-rom refs and archive names 2026-08-10 16:47:20 +02:00
Abdessamad Derraz 33a9934a11 feat: identify romsets from version recipes
A profile's contents: block and a DAT both state, per set, the members
one emulator version expects. Torrentzip makes archive bytes a function
of that list alone, so a recipe plus the roms reproduces the archive
exactly.

MAME ships its -listxml as a release asset and FBNeo keeps its dats in
its repository, so neither needs a browser. The importer streams the
311 MB document with a sliding window, resolves romof parents in two
passes, drops undumped members, and accumulates versions instead of
replacing them. Identical recipes shared across versions are stored once
with dats listing every version that agrees: 22 MAME versions give 23679
entries for 1726 distinct recipes, 18 MB down to 2.2 MB.

Snapshots live in recipes/ because load_provenance_snapshots reads every
provenance/*.json as a dump catalogue, and a recipe is not one.

1113 archives now reproduce byte for byte, against 175 from profiles
alone, and spec128.zip is rebuilt from roms already held.
2026-08-10 13:36:12 +02:00
Abdessamad Derraz 597a8ff919 fix: quote rom and core names in yaml
YAML 1.1 reads an unquoted 01 as the integer 1 and 81 as 81, so the
manager set stopped naming the file its driver opens and the API
published "cores": [2048] as a number where consumers match strings.

Ground truth from MAME 0.289 at the revision the profile cites:
src/mame/vtech/crvision.cpp:957 loads "01" and "23".

The root cause was the scraper: _hash_merge wrote these names through an
f-string, so quoting the profiles alone would be undone on the next
refresh. _yaml_scalar now quotes every name, archive and description it
writes.
2026-08-10 13:35:42 +02:00
Abdessamad Derraz 1c537c3a30 fix: keep mame refresh to profiles on mame's tree 2026-08-08 13:52:25 +02:00
Abdessamad Derraz 731096cf12 chore: refresh mame bios refs from 0.289 2026-08-08 13:50:25 +02:00
Abdessamad Derraz 89211003cb fix: refresh mame refs when a driver line moves 2026-08-08 13:48:54 +02:00
Abdessamad Derraz c4dbade280 fix: ignore commented flags in mame drivers 2026-08-08 08:11:58 +02:00
Abdessamad Derraz f4b02c2a43 feat: join dump-catalog provenance in database 2026-08-08 02:25:44 +02:00
Abdessamad Derraz 8663ec17b7 feat: add misterfpga platform support 2026-08-07 13:28:15 +02:00
Abdessamad Derraz 008268545d feat: add rocknix platform support 2026-08-06 18:37:21 +02:00
Abdessamad Derraz 6cbcb609af feat: scrape platform data from stable release tags 2026-08-06 16:41:47 +02:00
Abdessamad Derraz 077392bcd9 docs: add contributor attribution to romm and retrodeck scrapers 2026-04-02 11:41:15 +02:00
Abdessamad Derraz 0a272dc4e9 chore: lint and format entire codebase
Run ruff check --fix: remove unused imports (F401), fix f-strings
without placeholders (F541), remove unused variables (F841), fix
duplicate dict key (F601).

Run isort --profile black: normalize import ordering across all files.

Run ruff format: apply consistent formatting (black-compatible) to
all 58 Python files.

3 intentional E402 remain (imports after require_yaml() must execute
after yaml is available).
2026-04-01 13:17:55 +02:00
Abdessamad Derraz 427fef5669 fix: text-based YAML patching preserves formatting
replace yaml.dump with surgical text edits for contents/source_ref.
preserves comments, block scalars, quoting, indentation.
fix FBNeo new entry detection using parsed keys instead of text search.
2026-03-30 21:35:41 +02:00
Abdessamad Derraz 75e34898ee feat: add MAME/FBNeo hash auto-fetch scrapers
sparse clone upstream repos, parse BIOS root sets from C source,
cache as JSON, merge into emulator profiles with backup.
covers macro expansion, version detection, subset profile protection.
2026-03-30 19:11:26 +02:00
Abdessamad Derraz 94c3ac9834 feat: add hash merge for MAME and FBNeo profiles 2026-03-30 18:33:09 +02:00
Abdessamad Derraz 319a1d2041 feat: add MAME source code parser for BIOS root sets 2026-03-30 18:29:31 +02:00
Abdessamad Derraz 00d7b57884 feat: add FBNeo source parser for BIOS sets 2026-03-30 18:29:06 +02:00
Abdessamad Derraz 425ea064ae fix: scrapers merge into existing YAML instead of overwriting 2026-03-30 16:31:40 +02:00
Abdessamad Derraz e2d0510f4e fix: exporters match exact native formats with display names 2026-03-30 16:09:02 +02:00
Abdessamad Derraz 1f073f521d fix: preserve batocera version when github fetch fails 2026-03-30 11:55:57 +02:00
Abdessamad Derraz 4db9e4350c fix: add missing system slugs to batocera and retrobat scrapers 2026-03-30 07:58:46 +02:00
Abdessamad Derraz d3bd68f6ad feat: add vsmile, tutor, vg5k, vgmplay profiles and system aliases 2026-03-30 06:14:58 +02:00
Abdessamad Derraz 2e21d64a08 refactor: harden codebase and remove unicode artifacts
- fix urllib.parse.quote import (was urllib.request.quote)
- add operator precedence parens in generate_pack dedup check
- narrow bare except to specific types in batocera target scraper
- cache load_platform_config and build_zip_contents_index results
- add selective algorithm support to compute_hashes
- atomic write for fetch_large_file (tmp + rename)
- add response size limit to base scraper fetch
- extract build_target_cores_cache to common.py (dedup verify/pack)
- hoist _build_supplemental_index out of per-platform loop
- migrate function-attribute caches to module-level dicts
- add @abstractmethod to BaseTargetScraper.fetch_targets
- remove backward-compat re-exports from common.py
- replace em-dashes and unicode arrows with ASCII equivalents
- remove decorative section dividers and obvious comments
2026-03-29 23:15:20 +02:00