mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-04-13 12:22:33 -05:00
feat: add platform logos to registry and site
This commit is contained in:
@@ -10,6 +10,7 @@ platforms:
|
||||
retroarch:
|
||||
config: retroarch.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/libretro/RetroArch/master/media/retroarch-vector_invader-only.svg"
|
||||
scraper: libretro
|
||||
source_url: "https://raw.githubusercontent.com/libretro/libretro-database/master/dat/System.dat"
|
||||
source_format: clrmamepro_dat
|
||||
@@ -20,6 +21,7 @@ platforms:
|
||||
batocera:
|
||||
config: batocera.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/batocera-linux/batocera-emulationstation/master/resources/splash_batocera.svg"
|
||||
scraper: batocera
|
||||
source_url: "https://raw.githubusercontent.com/batocera-linux/batocera.linux/master/package/batocera/core/batocera-scripts/scripts/batocera-systems"
|
||||
source_format: python_dict
|
||||
@@ -30,6 +32,7 @@ platforms:
|
||||
recalbox:
|
||||
config: recalbox.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/homarr-labs/dashboard-icons/main/svg/recalbox.svg"
|
||||
scraper: recalbox
|
||||
source_url: "https://gitlab.com/recalbox/recalbox/-/raw/master/board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_bios.xml"
|
||||
source_format: xml
|
||||
@@ -40,6 +43,7 @@ platforms:
|
||||
retrobat:
|
||||
config: retrobat.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/RetroBat-Official/retrobat/main/system/resources/retrobat_logo_notext.png"
|
||||
scraper: retrobat
|
||||
source_url: "https://raw.githubusercontent.com/RetroBat-Official/emulatorlauncher/master/batocera-systems/Resources/batocera-systems.json"
|
||||
source_format: json
|
||||
@@ -50,6 +54,7 @@ platforms:
|
||||
emudeck:
|
||||
config: emudeck.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/dragoonDorise/EmuDeck/main/icons/EmuDeck.png"
|
||||
scraper: emudeck
|
||||
source_url: "https://raw.githubusercontent.com/dragoonDorise/EmuDeck/main/functions/checkBIOS.sh"
|
||||
source_wiki: "https://raw.githubusercontent.com/EmuDeck/emudeck.github.io/main/docs/tables/"
|
||||
@@ -63,6 +68,7 @@ platforms:
|
||||
lakka:
|
||||
config: lakka.yml
|
||||
status: active
|
||||
logo: "https://raw.githubusercontent.com/libretro/retroarch-assets/master/src/xmb/flatui/lakka.svg"
|
||||
scraper: libretro
|
||||
inherits_from: retroarch
|
||||
schedule: weekly
|
||||
@@ -70,5 +76,6 @@ platforms:
|
||||
retropie:
|
||||
config: retropie.yml
|
||||
status: archived # Last release: v4.8 (March 2022) - no update in 4 years
|
||||
logo: "https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/scriptmodules/system/RetroPie/icon.png"
|
||||
scraper: null
|
||||
schedule: null
|
||||
|
||||
@@ -107,7 +107,8 @@ def _load_emulator_profiles(emulators_dir: str) -> dict[str, dict]:
|
||||
# Home page
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def generate_home(db: dict, coverages: dict, emulator_count: int) -> str:
|
||||
def generate_home(db: dict, coverages: dict, emulator_count: int,
|
||||
registry: dict | None = None) -> str:
|
||||
total_files = db.get("total_files", 0)
|
||||
total_size = db.get("total_size", 0)
|
||||
ts = _timestamp()
|
||||
@@ -130,8 +131,10 @@ def generate_home(db: dict, coverages: dict, emulator_count: int) -> str:
|
||||
display = cov["platform"]
|
||||
total = cov["total"]
|
||||
mode = cov["mode"]
|
||||
logo_url = (registry or {}).get(name, {}).get("logo", "")
|
||||
logo_md = f"{{ width=24 }} " if logo_url else ""
|
||||
lines.append(
|
||||
f"| {display} | {total} | {mode} | "
|
||||
f"| {logo_md}{display} | {total} | {mode} | "
|
||||
f"[Download]({RELEASE_URL}) |"
|
||||
)
|
||||
|
||||
@@ -186,16 +189,19 @@ def generate_platform_index(coverages: dict) -> str:
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
def generate_platform_page(name: str, cov: dict) -> str:
|
||||
def generate_platform_page(name: str, cov: dict, registry: dict | None = None) -> str:
|
||||
config = cov["config"]
|
||||
display = cov["platform"]
|
||||
mode = cov["mode"]
|
||||
pct = _pct(cov["present"], cov["total"])
|
||||
|
||||
logo_url = (registry or {}).get(name, {}).get("logo", "")
|
||||
logo_md = f"{{ width=48 align=right }}\n\n" if logo_url else ""
|
||||
|
||||
lines = [
|
||||
f"# {display} - {SITE_NAME}",
|
||||
"",
|
||||
f"**Verification mode:** {mode}",
|
||||
logo_md + f"**Verification mode:** {mode}",
|
||||
f"**Coverage:** {cov['present']}/{cov['total']} ({pct})",
|
||||
f"**Verified:** {cov['verified']} | **Untested:** {cov['untested']} | **Missing:** {cov['missing']}",
|
||||
"",
|
||||
@@ -708,6 +714,13 @@ def main():
|
||||
for d in GENERATED_DIRS:
|
||||
(docs / d).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Load registry for platform metadata (logos, etc.)
|
||||
registry_path = Path(args.platforms_dir) / "_registry.yml"
|
||||
registry = {}
|
||||
if registry_path.exists():
|
||||
with open(registry_path) as f:
|
||||
registry = (yaml.safe_load(f) or {}).get("platforms", {})
|
||||
|
||||
# Load platform configs
|
||||
platform_names = [
|
||||
p.stem for p in Path(args.platforms_dir).glob("*.yml")
|
||||
@@ -736,13 +749,13 @@ def main():
|
||||
|
||||
# Generate home
|
||||
print("Generating home page...")
|
||||
(docs / "index.md").write_text(generate_home(db, coverages, unique_count))
|
||||
(docs / "index.md").write_text(generate_home(db, coverages, unique_count, registry))
|
||||
|
||||
# Generate platform pages
|
||||
print("Generating platform pages...")
|
||||
(docs / "platforms" / "index.md").write_text(generate_platform_index(coverages))
|
||||
for name, cov in coverages.items():
|
||||
(docs / "platforms" / f"{name}.md").write_text(generate_platform_page(name, cov))
|
||||
(docs / "platforms" / f"{name}.md").write_text(generate_platform_page(name, cov, registry))
|
||||
|
||||
# Generate system pages
|
||||
print("Generating system pages...")
|
||||
|
||||
Reference in New Issue
Block a user