diff --git a/ports/RGSX/config.py b/ports/RGSX/config.py index db2cb48..46b8edd 100644 --- a/ports/RGSX/config.py +++ b/ports/RGSX/config.py @@ -53,6 +53,7 @@ def get_system_root(): # tester si c'est batocera : if os.path.exists("/usr/share/batocera"): OPERATING_SYSTEM = "Batocera" + #remonter jusqu'à atteindre /userdata current_path = os.path.abspath(__file__) current_dir = current_path @@ -132,6 +133,7 @@ if not HEADLESS: print(f"IMAGES_FOLDER: {IMAGES_FOLDER}") print(f"GAMES_FOLDER: {GAMES_FOLDER}") print(f"SOURCES_FILE: {SOURCES_FILE}") + print(f"OPERATING_SYSTEM: {get_operating_system()}") # Constantes pour la répétition automatique dans pause_menu diff --git a/ports/RGSX/network.py b/ports/RGSX/network.py index 3f21f2b..6930c8e 100644 --- a/ports/RGSX/network.py +++ b/ports/RGSX/network.py @@ -613,6 +613,20 @@ async def download_rom(url, platform, game_name, is_zip_non_supported=False, tas break except Exception: pass + + # Exécuter la mise à jour de la liste des jeux d'EmulationStation UNIQUEMENT sur Batocera + try: + from config import get_operating_system + OPERATING_SYSTEM=get_operating_system() + if str(OPERATING_SYSTEM).lower() == "linux": + resp = requests.get("http://127.0.0.1:1234/reloadgames", timeout=2) + content = (resp.text or "").strip() + logger.debug(f"Résultat mise à jour liste des jeux: HTTP {resp.status_code} - {content}") + else: + logger.debug(f"Mise à jour liste des jeux ignorée (environnement non Linux: {getattr(config, 'OPERATING_SYSTEM', 'unknown')})") + except Exception as e: + logger.debug(f"Échec mise à jour via requête HTTP locale (Batocera): {e}") + # Nettoyer la queue if task_id in progress_queues: del progress_queues[task_id]