From 1f073f521d2cba5ccca1984437614bb229d72594 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 30 Mar 2026 11:55:57 +0200 Subject: [PATCH] fix: preserve batocera version when github fetch fails --- platforms/batocera.yml | 2 +- scripts/scraper/batocera_scraper.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platforms/batocera.yml b/platforms/batocera.yml index 2c036ded..b4e75b31 100644 --- a/platforms/batocera.yml +++ b/platforms/batocera.yml @@ -1,5 +1,5 @@ platform: Batocera -version: '' +version: '42' homepage: https://batocera.org source: https://raw.githubusercontent.com/batocera-linux/batocera.linux/master/package/batocera/core/batocera-scripts/scripts/batocera-systems base_destination: bios diff --git a/scripts/scraper/batocera_scraper.py b/scripts/scraper/batocera_scraper.py index 95fbbe82..8a4e0a76 100644 --- a/scripts/scraper/batocera_scraper.py +++ b/scripts/scraper/batocera_scraper.py @@ -329,6 +329,13 @@ class Scraper(BaseScraper): num = tag.removeprefix("batocera-") if num.isdigit(): batocera_version = num + if not batocera_version: + # Preserve existing version when fetch fails (offline mode) + existing = Path(__file__).resolve().parents[2] / "platforms" / "batocera.yml" + if existing.exists(): + with open(existing) as f: + old = yaml.safe_load(f) or {} + batocera_version = str(old.get("version", "")) cores, standalone = self._fetch_cores() result = {