Files
romm/backend/tools
Sam Dornan 20ee013e09 fix(tools): repair the test-data seeder's imports and rom digests
`tools/generate_test_data.py` could not run at all. It imported
`UniversalPlatformSlug` from `handler.metadata.base_handler`, where the enum
no longer lives, and it built `Rom` rows without `full_path_hash`, which is
NOT NULL, so the first insert of every run failed.

The import block's `isort: off` workaround went with the enum: it loaded the
metadata package before `adapters.services.igdb` to break a
`base_handler <-> igdb` cycle that no longer exists, since `base_handler` does
not import the igdb service. `adapters.services.igdb` can be imported first.

The digest comes from `compute_full_path_hash(fs_path, fs_name)`, the same call
the scanner writes with, computed from the row's own folder, so the seeded
library satisfies the unique index on `(platform_id, full_path_hash)`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 11:27:13 -05:00
..