forked from Mirrors/RGSX
v2.2.0.7 - feat: enhance unsupported systems display and update extraction handling for Xbox
This commit is contained in:
@@ -13,7 +13,7 @@ except Exception:
|
|||||||
pygame = None # type: ignore
|
pygame = None # type: ignore
|
||||||
|
|
||||||
# Version actuelle de l'application
|
# Version actuelle de l'application
|
||||||
app_version = "2.2.0.6"
|
app_version = "2.2.0.7"
|
||||||
|
|
||||||
def get_operating_system():
|
def get_operating_system():
|
||||||
"""Renvoie le nom du système d'exploitation."""
|
"""Renvoie le nom du système d'exploitation."""
|
||||||
|
|||||||
@@ -1347,8 +1347,10 @@ def draw_display_menu(screen):
|
|||||||
hidden_count = 0 if show_unsupported else len(list(unsupported_list))
|
hidden_count = 0 if show_unsupported else len(list(unsupported_list))
|
||||||
except Exception:
|
except Exception:
|
||||||
hidden_count = 0
|
hidden_count = 0
|
||||||
unsupported_label = ((_("menu_show_unsupported_on") if show_unsupported else _("menu_show_unsupported_off"))
|
if hidden_count > 0:
|
||||||
+ f" ({hidden_count})")
|
unsupported_label = _("menu_show_unsupported_and_hidden").format(hidden_count)
|
||||||
|
else:
|
||||||
|
unsupported_label = _("menu_show_unsupported_all_displayed")
|
||||||
|
|
||||||
# Libellés
|
# Libellés
|
||||||
options = [
|
options = [
|
||||||
|
|||||||
@@ -95,6 +95,7 @@
|
|||||||
"filter_unsaved_warning": "Ungespeicherte Änderungen",
|
"filter_unsaved_warning": "Ungespeicherte Änderungen",
|
||||||
"menu_show_unsupported_on": "Nicht unterstützte Systeme anzeigen: Ja",
|
"menu_show_unsupported_on": "Nicht unterstützte Systeme anzeigen: Ja",
|
||||||
"menu_show_unsupported_off": "Nicht unterstützte Systeme anzeigen: Nein",
|
"menu_show_unsupported_off": "Nicht unterstützte Systeme anzeigen: Nein",
|
||||||
|
"menu_show_unsupported_text": "systeme versteckt",
|
||||||
"menu_show_unsupported_enabled": "Sichtbarkeit nicht unterstützter Systeme aktiviert",
|
"menu_show_unsupported_enabled": "Sichtbarkeit nicht unterstützter Systeme aktiviert",
|
||||||
"menu_show_unsupported_disabled": "Sichtbarkeit nicht unterstützter Systeme deaktiviert",
|
"menu_show_unsupported_disabled": "Sichtbarkeit nicht unterstützter Systeme deaktiviert",
|
||||||
"menu_allow_unknown_ext_on": "Warnung bei unbekannter Erweiterung ausblenden: Ja",
|
"menu_allow_unknown_ext_on": "Warnung bei unbekannter Erweiterung ausblenden: Ja",
|
||||||
@@ -219,5 +220,7 @@
|
|||||||
,
|
,
|
||||||
"sources_mode_custom_select_info": "Benutzerdefiniert: URL in {0} setzen und Spieleliste aktualisieren",
|
"sources_mode_custom_select_info": "Benutzerdefiniert: URL in {0} setzen und Spieleliste aktualisieren",
|
||||||
"sources_mode_custom_missing_url": "Keine benutzerdefinierte URL gesetzt (bearbeite {0})",
|
"sources_mode_custom_missing_url": "Keine benutzerdefinierte URL gesetzt (bearbeite {0})",
|
||||||
"sources_mode_custom_download_error": "Download der benutzerdefinierten Quelle fehlgeschlagen"
|
"sources_mode_custom_download_error": "Download der benutzerdefinierten Quelle fehlgeschlagen",
|
||||||
|
"menu_show_unsupported_and_hidden": "{0} nicht unterstützte und ausgeblendete Systeme anzeigen",
|
||||||
|
"menu_show_unsupported_all_displayed": "Alle Systeme angezeigt"
|
||||||
}
|
}
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
"filter_unsaved_warning": "Unsaved changes",
|
"filter_unsaved_warning": "Unsaved changes",
|
||||||
"menu_show_unsupported_on": "Show unsupported systems: Yes",
|
"menu_show_unsupported_on": "Show unsupported systems: Yes",
|
||||||
"menu_show_unsupported_off": "Show unsupported systems: No",
|
"menu_show_unsupported_off": "Show unsupported systems: No",
|
||||||
|
"menu_show_unsupported_text": "hidden systems",
|
||||||
"menu_show_unsupported_enabled": "Unsupported systems visibility enabled",
|
"menu_show_unsupported_enabled": "Unsupported systems visibility enabled",
|
||||||
"menu_show_unsupported_disabled": "Unsupported systems visibility disabled",
|
"menu_show_unsupported_disabled": "Unsupported systems visibility disabled",
|
||||||
"menu_allow_unknown_ext_on": "Hide unknown extension warning: Yes",
|
"menu_allow_unknown_ext_on": "Hide unknown extension warning: Yes",
|
||||||
@@ -219,5 +220,7 @@
|
|||||||
|
|
||||||
"sources_mode_custom_select_info": "Custom mode: set URL in {0} then update games list",
|
"sources_mode_custom_select_info": "Custom mode: set URL in {0} then update games list",
|
||||||
"sources_mode_custom_missing_url": "No custom URL set (edit {0})",
|
"sources_mode_custom_missing_url": "No custom URL set (edit {0})",
|
||||||
"sources_mode_custom_download_error": "Custom source download failed"
|
"sources_mode_custom_download_error": "Custom source download failed",
|
||||||
|
"menu_show_unsupported_and_hidden": "Show unsupported and hidden {0} systems",
|
||||||
|
"menu_show_unsupported_all_displayed": "Hide all unsupported systems"
|
||||||
}
|
}
|
||||||
@@ -96,6 +96,7 @@
|
|||||||
"filter_unsaved_warning": "Cambios no guardados",
|
"filter_unsaved_warning": "Cambios no guardados",
|
||||||
"menu_show_unsupported_on": "Mostrar sistemas no soportados: Sí",
|
"menu_show_unsupported_on": "Mostrar sistemas no soportados: Sí",
|
||||||
"menu_show_unsupported_off": "Mostrar sistemas no soportados: No",
|
"menu_show_unsupported_off": "Mostrar sistemas no soportados: No",
|
||||||
|
"menu_show_unsupported_text": "sistemas ocultos",
|
||||||
"menu_show_unsupported_enabled": "Visibilidad de sistemas no soportados activada",
|
"menu_show_unsupported_enabled": "Visibilidad de sistemas no soportados activada",
|
||||||
"menu_show_unsupported_disabled": "Visibilidad de sistemas no soportados desactivada",
|
"menu_show_unsupported_disabled": "Visibilidad de sistemas no soportados desactivada",
|
||||||
"menu_allow_unknown_ext_on": "Ocultar aviso de extensión desconocida: Sí",
|
"menu_allow_unknown_ext_on": "Ocultar aviso de extensión desconocida: Sí",
|
||||||
@@ -219,5 +220,7 @@
|
|||||||
"games_source_custom": "Personalizado",
|
"games_source_custom": "Personalizado",
|
||||||
"sources_mode_custom_select_info": "Modo personalizado: define la URL en {0} y actualiza la lista de juegos",
|
"sources_mode_custom_select_info": "Modo personalizado: define la URL en {0} y actualiza la lista de juegos",
|
||||||
"sources_mode_custom_missing_url": "No se ha establecido URL personalizada (editar {0})",
|
"sources_mode_custom_missing_url": "No se ha establecido URL personalizada (editar {0})",
|
||||||
"sources_mode_custom_download_error": "Fallo en la descarga de la fuente personalizada"
|
"sources_mode_custom_download_error": "Fallo en la descarga de la fuente personalizada",
|
||||||
|
"menu_show_unsupported_and_hidden": "Mostrar {0} sistemas no soportados y ocultos",
|
||||||
|
"menu_show_unsupported_all_displayed": "Todos los sistemas mostrados"
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,7 @@
|
|||||||
"filter_unsaved_warning": "Modifications non sauvegardées",
|
"filter_unsaved_warning": "Modifications non sauvegardées",
|
||||||
"menu_show_unsupported_on": "Afficher systèmes non supportés : Oui",
|
"menu_show_unsupported_on": "Afficher systèmes non supportés : Oui",
|
||||||
"menu_show_unsupported_off": "Afficher systèmes non supportés : Non",
|
"menu_show_unsupported_off": "Afficher systèmes non supportés : Non",
|
||||||
|
"menu_show_unsupported_text": "systèmes cachés",
|
||||||
"menu_show_unsupported_enabled": "Affichage systèmes non supportés activé",
|
"menu_show_unsupported_enabled": "Affichage systèmes non supportés activé",
|
||||||
"menu_show_unsupported_disabled": "Affichage systèmes non supportés désactivé",
|
"menu_show_unsupported_disabled": "Affichage systèmes non supportés désactivé",
|
||||||
"menu_allow_unknown_ext_on": "Masquer avertissement extension inconnue : Oui",
|
"menu_allow_unknown_ext_on": "Masquer avertissement extension inconnue : Oui",
|
||||||
@@ -219,5 +220,7 @@
|
|||||||
"games_source_custom": "Personnalisée",
|
"games_source_custom": "Personnalisée",
|
||||||
"sources_mode_custom_select_info": "Mode personnalisé : définir l'URL dans {0} puis mettre à jour la liste des jeux",
|
"sources_mode_custom_select_info": "Mode personnalisé : définir l'URL dans {0} puis mettre à jour la liste des jeux",
|
||||||
"sources_mode_custom_missing_url": "Aucune URL personnalisée définie (modifier {0})",
|
"sources_mode_custom_missing_url": "Aucune URL personnalisée définie (modifier {0})",
|
||||||
"sources_mode_custom_download_error": "Échec du téléchargement de la source personnalisée"
|
"sources_mode_custom_download_error": "Échec du téléchargement de la source personnalisée",
|
||||||
|
"menu_show_unsupported_and_hidden": "Afficher les systèmes non supportés et masqués : {0}",
|
||||||
|
"menu_show_unsupported_all_displayed": "Tous les systèmes sont affichés"
|
||||||
}
|
}
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
"filter_unsaved_warning": "Modifiche non salvate",
|
"filter_unsaved_warning": "Modifiche non salvate",
|
||||||
"menu_show_unsupported_on": "Mostra sistemi non supportati: Sì",
|
"menu_show_unsupported_on": "Mostra sistemi non supportati: Sì",
|
||||||
"menu_show_unsupported_off": "Mostra sistemi non supportati: No",
|
"menu_show_unsupported_off": "Mostra sistemi non supportati: No",
|
||||||
|
"menu_show_unsupported_text": "sistemi nascosti",
|
||||||
"menu_show_unsupported_enabled": "Visibilità sistemi non supportati abilitata",
|
"menu_show_unsupported_enabled": "Visibilità sistemi non supportati abilitata",
|
||||||
"menu_show_unsupported_disabled": "Visibilità sistemi non supportati disabilitata",
|
"menu_show_unsupported_disabled": "Visibilità sistemi non supportati disabilitata",
|
||||||
"menu_allow_unknown_ext_on": "Nascondi avviso estensione sconosciuta: Sì",
|
"menu_allow_unknown_ext_on": "Nascondi avviso estensione sconosciuta: Sì",
|
||||||
@@ -217,5 +218,7 @@
|
|||||||
"games_source_custom": "Personalizzato",
|
"games_source_custom": "Personalizzato",
|
||||||
"sources_mode_custom_select_info": "Modalità personalizzata: imposta l'URL in {0} poi aggiorna l'elenco giochi",
|
"sources_mode_custom_select_info": "Modalità personalizzata: imposta l'URL in {0} poi aggiorna l'elenco giochi",
|
||||||
"sources_mode_custom_missing_url": "Nessun URL personalizzato impostato (modifica {0})",
|
"sources_mode_custom_missing_url": "Nessun URL personalizzato impostato (modifica {0})",
|
||||||
"sources_mode_custom_download_error": "Download sorgente personalizzata fallito"
|
"sources_mode_custom_download_error": "Download sorgente personalizzata fallito",
|
||||||
|
"menu_show_unsupported_and_hidden": "Mostra {0} sistemi non supportati e nascosti",
|
||||||
|
"menu_show_unsupported_all_displayed": "Tutti i sistemi visualizzati"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,6 +95,7 @@
|
|||||||
"filter_unsaved_warning": "Alterações não salvas",
|
"filter_unsaved_warning": "Alterações não salvas",
|
||||||
"menu_show_unsupported_on": "Mostrar sistemas não suportados: Sim",
|
"menu_show_unsupported_on": "Mostrar sistemas não suportados: Sim",
|
||||||
"menu_show_unsupported_off": "Mostrar sistemas não suportados: Não",
|
"menu_show_unsupported_off": "Mostrar sistemas não suportados: Não",
|
||||||
|
"menu_show_unsupported_text": "sistemas ocultos",
|
||||||
"menu_show_unsupported_enabled": "Visibilidade de sistemas não suportados ativada",
|
"menu_show_unsupported_enabled": "Visibilidade de sistemas não suportados ativada",
|
||||||
"menu_show_unsupported_disabled": "Visibilidade de sistemas não suportados desativada",
|
"menu_show_unsupported_disabled": "Visibilidade de sistemas não suportados desativada",
|
||||||
"menu_allow_unknown_ext_on": "Ocultar aviso de extensão desconhecida: Sim",
|
"menu_allow_unknown_ext_on": "Ocultar aviso de extensão desconhecida: Sim",
|
||||||
@@ -217,5 +218,7 @@
|
|||||||
"games_source_custom": "Personalizado",
|
"games_source_custom": "Personalizado",
|
||||||
"sources_mode_custom_select_info": "Modo personalizado: defina a URL em {0} e depois atualize a lista de jogos",
|
"sources_mode_custom_select_info": "Modo personalizado: defina a URL em {0} e depois atualize a lista de jogos",
|
||||||
"sources_mode_custom_missing_url": "Nenhuma URL personalizada definida (edite {0})",
|
"sources_mode_custom_missing_url": "Nenhuma URL personalizada definida (edite {0})",
|
||||||
"sources_mode_custom_download_error": "Falha no download da fonte personalizada"
|
"sources_mode_custom_download_error": "Falha no download da fonte personalizada",
|
||||||
|
"menu_show_unsupported_and_hidden": "Mostrar {0} sistemas não suportados e ocultos",
|
||||||
|
"menu_show_unsupported_all_displayed": "Todos os sistemas exibidos"
|
||||||
}
|
}
|
||||||
@@ -839,7 +839,7 @@ def extract_zip(zip_path, dest_dir, url):
|
|||||||
iso_after.add(os.path.abspath(os.path.join(root, file)))
|
iso_after.add(os.path.abspath(os.path.join(root, file)))
|
||||||
new_isos = list(iso_after - iso_before)
|
new_isos = list(iso_after - iso_before)
|
||||||
if new_isos:
|
if new_isos:
|
||||||
success, error_msg = handle_xbox(dest_dir, new_isos)
|
success, error_msg = handle_xbox(dest_dir, new_isos, url)
|
||||||
if not success:
|
if not success:
|
||||||
return False, error_msg
|
return False, error_msg
|
||||||
else:
|
else:
|
||||||
@@ -850,18 +850,27 @@ def extract_zip(zip_path, dest_dir, url):
|
|||||||
os.remove(zip_path)
|
os.remove(zip_path)
|
||||||
logger.info(f"Fichier ZIP {zip_path} extrait dans {dest_dir} et supprimé")
|
logger.info(f"Fichier ZIP {zip_path} extrait dans {dest_dir} et supprimé")
|
||||||
|
|
||||||
# Mettre à jour le statut final dans l'historique
|
# Mettre à jour le statut final dans l'historique (couvre "Extracting" et "Converting")
|
||||||
if isinstance(config.history, list):
|
try:
|
||||||
for entry in config.history:
|
if isinstance(config.history, list):
|
||||||
if "status" in entry and entry["status"] == "Extracting":
|
for entry in config.history:
|
||||||
entry["status"] = "Download_OK"
|
if entry.get("url") == url and entry.get("status") in ("Extracting", "Converting"):
|
||||||
entry["progress"] = 100
|
entry["status"] = "Download_OK"
|
||||||
# Utiliser une variable intermédiaire pour stocker le message
|
entry["progress"] = 100
|
||||||
message_text = _("utils_extracted").format(os.path.basename(zip_path))
|
message_text = _("utils_extracted").format(os.path.basename(zip_path))
|
||||||
entry["message"] = message_text
|
entry["message"] = message_text
|
||||||
save_history(config.history)
|
save_history(config.history)
|
||||||
config.needs_redraw = True
|
config.needs_redraw = True
|
||||||
break
|
break
|
||||||
|
# Mettre à jour l'état de progression à 100%
|
||||||
|
if url in getattr(config, 'download_progress', {}):
|
||||||
|
try:
|
||||||
|
config.download_progress[url]["status"] = "Download_OK"
|
||||||
|
config.download_progress[url]["progress_percent"] = 100
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(f"MAJ statut final après conversion: ignorée ({e})")
|
||||||
|
|
||||||
return True, _("utils_extracted").format(os.path.basename(zip_path))
|
return True, _("utils_extracted").format(os.path.basename(zip_path))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -1079,8 +1088,8 @@ def handle_ps3(dest_dir):
|
|||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
|
|
||||||
def handle_xbox(dest_dir, iso_files):
|
def handle_xbox(dest_dir, iso_files, url=None):
|
||||||
"""Gère la conversion des fichiers Xbox extraits."""
|
"""Gère la conversion des fichiers Xbox extraits et met à jour l'UI (Converting)."""
|
||||||
logger.debug(f"Traitement spécifique Xbox dans: {dest_dir}")
|
logger.debug(f"Traitement spécifique Xbox dans: {dest_dir}")
|
||||||
|
|
||||||
# Attendre un peu que tous les processus d'extraction se terminent
|
# Attendre un peu que tous les processus d'extraction se terminent
|
||||||
@@ -1115,7 +1124,7 @@ def handle_xbox(dest_dir, iso_files):
|
|||||||
xdvdfs_cmd = [XDVDFS_LINUX, "pack"] # Liste avec 2 éléments
|
xdvdfs_cmd = [XDVDFS_LINUX, "pack"] # Liste avec 2 éléments
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Chercher les fichiers ISO à convertir
|
# Chercher les fichiers ISO à convertir (rafraîchir la liste)
|
||||||
iso_files = []
|
iso_files = []
|
||||||
for root, dirs, files in os.walk(dest_dir):
|
for root, dirs, files in os.walk(dest_dir):
|
||||||
for file in files:
|
for file in files:
|
||||||
@@ -1126,7 +1135,30 @@ def handle_xbox(dest_dir, iso_files):
|
|||||||
logger.warning("Aucun fichier ISO xbox trouvé")
|
logger.warning("Aucun fichier ISO xbox trouvé")
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
for iso_xbox_source in iso_files:
|
total = len(iso_files)
|
||||||
|
# Marquer l'état comme Conversion en cours (0%)
|
||||||
|
try:
|
||||||
|
if url:
|
||||||
|
# Progress dict (pour l'écran en cours)
|
||||||
|
if url not in config.download_progress:
|
||||||
|
config.download_progress[url] = {}
|
||||||
|
config.download_progress[url]["status"] = "Converting"
|
||||||
|
config.download_progress[url]["progress_percent"] = 0
|
||||||
|
config.needs_redraw = True
|
||||||
|
# Historique
|
||||||
|
if isinstance(config.history, list):
|
||||||
|
for entry in config.history:
|
||||||
|
if entry.get("url") == url and entry.get("status") in ["Extracting", "Téléchargement", "downloading"]:
|
||||||
|
entry["status"] = "Converting"
|
||||||
|
entry["progress"] = 0
|
||||||
|
entry["message"] = "Xbox conversion in progress"
|
||||||
|
save_history(config.history)
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug(f"MAJ statut conversion ignorée: {e}")
|
||||||
|
|
||||||
|
logger.info(f"Démarrage conversion Xbox: {total} ISO(s)")
|
||||||
|
for idx, iso_xbox_source in enumerate(iso_files, start=1):
|
||||||
logger.debug(f"Traitement de l'ISO Xbox: {iso_xbox_source}")
|
logger.debug(f"Traitement de l'ISO Xbox: {iso_xbox_source}")
|
||||||
xiso_dest = os.path.splitext(iso_xbox_source)[0] + "_xbox.iso"
|
xiso_dest = os.path.splitext(iso_xbox_source)[0] + "_xbox.iso"
|
||||||
|
|
||||||
@@ -1151,6 +1183,23 @@ def handle_xbox(dest_dir, iso_files):
|
|||||||
os.remove(iso_xbox_source)
|
os.remove(iso_xbox_source)
|
||||||
os.rename(xiso_dest, iso_xbox_source)
|
os.rename(xiso_dest, iso_xbox_source)
|
||||||
logger.debug(f"ISO original remplacé par la version convertie")
|
logger.debug(f"ISO original remplacé par la version convertie")
|
||||||
|
# Mise à jour progression de conversion (coarse-grain)
|
||||||
|
try:
|
||||||
|
percent = int(idx / total * 100) if total > 0 else 100
|
||||||
|
if url:
|
||||||
|
if url not in config.download_progress:
|
||||||
|
config.download_progress[url] = {}
|
||||||
|
config.download_progress[url]["status"] = "Converting"
|
||||||
|
config.download_progress[url]["progress_percent"] = percent
|
||||||
|
config.needs_redraw = True
|
||||||
|
if isinstance(config.history, list):
|
||||||
|
for entry in config.history:
|
||||||
|
if entry.get("url") == url and entry.get("status") == "Converting":
|
||||||
|
entry["progress"] = percent
|
||||||
|
save_history(config.history)
|
||||||
|
break
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
logger.error(f"L'ISO converti n'a pas été créé: {xiso_dest}")
|
logger.error(f"L'ISO converti n'a pas été créé: {xiso_dest}")
|
||||||
return False, "Échec de la conversion de l'ISO"
|
return False, "Échec de la conversion de l'ISO"
|
||||||
|
|||||||
Reference in New Issue
Block a user