From 68800a49d13a820186c447de5457720916bf67d6 Mon Sep 17 00:00:00 2001 From: jamulix Date: Tue, 21 Oct 2025 15:10:43 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Korrigiere=20JSON-Datei-Ladefehler=20und?= =?UTF-8?q?=20f=C3=BCge=20Debug-Route=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (ollama_chat/qwen3-coder:30b) --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index 30465c8..1817d29 100644 --- a/app.py +++ b/app.py @@ -99,11 +99,21 @@ def debug(): """Debug-Route zum Überprüfen der Lektionen und Konfiguration""" progress = Progress.query.first() + # Versuche, den Inhalt der JSON-Datei zu lesen + json_content = "Datei nicht gefunden" + try: + if os.path.exists(DATA_PATH): + with open(DATA_PATH, "r", encoding="utf-8") as f: + json_content = f.read() + except Exception as e: + json_content = f"Fehler beim Lesen der Datei: {e}" + debug_info = { 'lessons_loaded': len(lessons), 'lessons_content': lessons, 'data_path': DATA_PATH, 'file_exists': os.path.exists(DATA_PATH), + 'file_content': json_content[:500] + '...' if len(json_content) > 500 else json_content, 'current_progress': { 'current_text_index': progress.current_text_index if progress else None, 'current_position': progress.current_position if progress else None,