diff --git a/ports/RGSX/config.py b/ports/RGSX/config.py index 0c4d312..df319f9 100644 --- a/ports/RGSX/config.py +++ b/ports/RGSX/config.py @@ -13,7 +13,7 @@ except Exception: pygame = None # type: ignore # Version actuelle de l'application -app_version = "2.3.1.2.1" +app_version = "2.3.1.3" def get_application_root(): @@ -98,7 +98,7 @@ GITHUB_RELEASES_URL = f"https://github.com/{GITHUB_REPO}/releases" # URLs pour les mises à jour OTA (Over-The-Air) # Utilise le fichier RGSX_latest.zip qui pointe toujours vers la dernière version OTA_UPDATE_ZIP = f"{GITHUB_RELEASES_URL}/latest/download/RGSX_update_latest.zip" -OTA_VERSION_ENDPOINT = "https://retrogamesets.fr/softs/version.json" # Endpoint pour vérifier la version disponible +OTA_VERSION_ENDPOINT = "https://raw.githubusercontent.com/RetroGameSets/RGSX/refs/heads/main/version.json" # Endpoint pour vérifier la version disponible # URLs legacy (conservées pour compatibilité) OTA_SERVER_URL = "https://retrogamesets.fr/softs/" diff --git a/ports/RGSX/network.py b/ports/RGSX/network.py index 90ecb53..0f12966 100644 --- a/ports/RGSX/network.py +++ b/ports/RGSX/network.py @@ -455,10 +455,15 @@ async def check_for_updates(): response = requests.get(OTA_VERSION_ENDPOINT, timeout=5) response.raise_for_status() - if response.headers.get("content-type") != "application/json": + + # Accepter différents content-types (application/json, text/plain, text/html) + content_type = response.headers.get("content-type", "") + allowed_types = ["application/json", "text/plain", "text/html"] + if not any(allowed in content_type for allowed in allowed_types): raise ValueError( - f"Le fichier version.json n'est pas un JSON valide (type de contenu : {response.headers.get('content-type')})" + f"Le fichier version.json n'est pas un JSON valide (type de contenu : {content_type})" ) + version_data = response.json() latest_version = version_data.get("version") logger.debug(f"Version distante : {latest_version}, version locale : {config.app_version}")