refactor: one manufacturer slug in the collection

This commit is contained in:
Abdessamad Derraz committed 2026-11-18 19:31:28 +01:00
1 parent dc4fb652a6
commit cbfa26f315
4 files changed
+11 -15

No files matched your search

+2 -6
View File
@@ -188,10 +188,6 @@ def _profiles_in(emulators_dir: str, skip_aliases: bool) -> dict[str, dict]:
return load_emulator_profiles(emulators_dir, skip_aliases=skip_aliases)
def _manufacturer_slug(manufacturer: str) -> str:
return manufacturer.lower().replace(" ", "-")
# (manufacturer slug, folder, sha1) -> the (manufacturer slug, console) a
# copy's card went to when the system pages file it outside its folder:
# ScummVM's engine data under Other/ScummVM, neogeo.zip under Arcade.
@@ -202,8 +198,8 @@ def record_card_move(manufacturer: str, folder: str, sha1: str,
to_manufacturer: str, to_console: str) -> None:
"""Mark that the card of the copy under bios/<manufacturer>/<folder>/
sits in the section (to_manufacturer, to_console)."""
_card_moves[(_manufacturer_slug(manufacturer), folder, str(sha1))] = (
_manufacturer_slug(to_manufacturer), to_console)
_card_moves[(_slug(manufacturer), folder, str(sha1))] = (
_slug(to_manufacturer), to_console)
# System display names. A system is named by the heading of the console
+2 -2
View File
@@ -3,7 +3,7 @@
from __future__ import annotations
from model import siteinputs
from model.collection import SECTION_LABELS, _PROGRAM_TOPS, _manufacturer_slug
from model.collection import SECTION_LABELS, _PROGRAM_TOPS, _slug
# (manufacturer slug, console) -> the id of the console's heading. Two
@@ -76,7 +76,7 @@ def set_console_sections(
for mfr, consoles in by_maker.items():
used = {toc_slug(mfr)}
for console in sorted(consoles):
_console_anchors[(_manufacturer_slug(mfr), console)] = _unique(toc_slug(console), used)
_console_anchors[(_slug(mfr), console)] = _unique(toc_slug(console), used)
for mfr, console in pairs:
spelled = console.lower().replace(" ", "-")
slug = mfr.lower().replace(" ", "-")