1
0
forked from Mirrors/RGSX

v2.2.0.7 - update batocera gamelist after download automatically (thanks to focalabroc for command, adapted)

This commit is contained in:
skymike03
2025-09-11 01:28:27 +02:00
parent 3d8a2fac26
commit ea565f7c46
2 changed files with 16 additions and 0 deletions

View File

@@ -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

View File

@@ -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]