fix: show where each platform's pack goes

Platform pages labelled base_destination, the root the platform's own list writes from, as the BIOS path, so EmuDeck read bios/ where the pack goes into ~/Emulation/bios/. The row now gives the registry's extract_to, the folder the README and the pack guide name. A platform that names no file (MinUI and its forks) showed 0/0 coverage and an empty systems table; its page now lists each core folder with the files the pack puts in it.
This commit is contained in:
Abdessamad Derraz committed 2026-10-22 10:56:35 +02:00
1 parent fa7769bea7
commit 4501601769
2 files changed
+80 -7

No files matched your search

+59 -7
View File
@@ -2088,6 +2088,36 @@ def _category_evidence_md(evidence: dict) -> str:
return f"No reader found ({cores})"
def _core_folders_section(name: str, config: dict) -> list[str]:
"""Each folder the frontend hands a core, and the files the pack puts in it.
For a platform that names no file of its own (MinUI and its forks): the
folders come from its launch scripts, the files from its install manifest.
"""
folders = config.get("core_system_dirs") or {}
manifest = _REPO_ROOT / "install" / f"{name}.json"
files = json.loads(manifest.read_text())["files"] if manifest.is_file() else []
lines = [
"## Core folders",
"",
"Each folder below is the one the frontend gives that core. The pack "
"puts the files the core reads there.",
"",
"| Folder | Cores | Files |",
"|--------|-------|-------|",
]
for folder, info in sorted(folders.items()):
held = sorted(
f["dest"][len(folder) + 1:] for f in files
if f.get("dest", "").startswith(folder + "/")
)
cores = ", ".join(_emulator_link(c, "../") for c in info.get("cores", []))
shown = ", ".join(f"`{n}`" for n in held) if held else "none needed"
lines.append(f"| `{folder}/` | {cores} | {shown} |")
lines.append("")
return lines
def generate_platform_page(
name: str,
cov: dict,
@@ -2131,8 +2161,22 @@ def generate_platform_page(
]
)
lines.extend(
[
no_list = not cov["total"] and (registry or {}).get(name, {}).get("native_list") == "none"
if no_list:
# MinUI and its forks hand each core a folder and name no file: a
# 0/0 coverage band read as "this device is not supported".
lines.extend(
[
'!!! info "No BIOS list of its own"',
"",
f" {display} names no BIOS file itself: it gives each emulator core "
"its own folder and the core looks for its files there. The pack "
"places every file the cores it runs need into those folders. The "
"core files are listed further down this page.",
"",
]
)
band = [] if no_list else [
'<div class="rb-stats" markdown>',
"",
'<div class="rb-stat" markdown>',
@@ -2158,16 +2202,21 @@ def generate_platform_page(
"",
"</div>",
"",
"| | |",
"|---|---|",
]
)
lines.extend([*band, "| | |", "|---|---|"])
if hash_type:
lines.append(f"| Hash type | {hash_type} |")
if version:
lines.append(f"| Version | {version} |")
# Where a user puts the pack, from the registry the README and the pack
# guide read too. base_destination is only the root the platform's own
# list writes its paths from: the pack strips it, so it is no folder to
# extract into, and showing it as "BIOS path" sent EmuDeck users to bios/.
extract_to = (registry or {}).get(name, {}).get("extract_to")
if extract_to:
lines.append(f"| Extract the pack into | `{extract_to}` |")
if base_dest:
lines.append(f"| BIOS path | `{base_dest}/` |")
lines.append(f"| Paths in the platform's list start at | `{base_dest}/` |")
if homepage:
lines.append(f"| Homepage | [{homepage}]({homepage}) |")
transcribed = str(config.get("source") or "")
@@ -2219,9 +2268,12 @@ def generate_platform_page(
sys_id = d.get("system", "unknown")
by_system.setdefault(sys_id, []).append(d)
if no_list:
lines.extend(_core_folders_section(name, config))
# System summary table (quick navigation)
lines.extend(
[
[] if no_list and not by_system else [
"## Systems overview",
"",
"| System | Files | Status | Emulators |",
+21
View File
@@ -410,6 +410,27 @@ class InstallerReadsTheCard(unittest.TestCase):
install._check_card_root("minui", self.root / "Bios")
install._check_card_root("minui", self.root)
class TheSitePageOfACardPlatform(unittest.TestCase):
"""A platform that names no file showed "0/0 Coverage (0%)" and an empty
systems table, which read as "not supported". Its page lists the folders
the frontend hands its cores and the files the pack puts in each."""
def test_folders_replace_the_empty_coverage(self):
import generate_site
from common import load_database, load_platform_registry
from generate_readme import compute_coverage
if not (REPO_ROOT / "database.json").is_file():
self.skipTest("database.json absent")
registry = load_platform_registry(str(REPO_ROOT / "platforms"))
db = load_database(str(REPO_ROOT / "database.json"))
cov = compute_coverage("minui", str(REPO_ROOT / "platforms"), db)
page = generate_site.generate_platform_page("minui", cov, registry, {})
self.assertNotIn("0/0", page)
self.assertNotIn("## Systems overview", page)
self.assertIn("| `Bios/PS/` | [pcsx_rearmed](../emulators/pcsx_rearmed.md) |", page)
self.assertIn("| Extract the pack into | `<SD card>/` |", page)
if __name__ == "__main__":
unittest.main()