fix(diarization-ui): have _job_get return dict instead of sqlite3.Row

sqlite3.Row does not support .get() — converting to dict at the source
fixes all current and future call sites uniformly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-27 10:06:41 +01:00
parent 89affe41b0
commit bdff373959

5
app.py
View File

@@ -280,7 +280,8 @@ def get_prompts():
def _job_get(job_id: int):
with db() as c:
return c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone()
row = c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone()
return dict(row) if row else None
def _job_set(job_id: int, **fields):
@@ -348,7 +349,7 @@ def _process_analysis_job(job_id: int):
if not doc or not prm:
raise RuntimeError("Dokument oder Prompt nicht gefunden")
user_extra = (j["user_prompt"] or "").strip() if j["user_prompt"] is not None else ""
user_extra = (j.get("user_prompt") or "").strip()
llm_prompt = (
"Du bist ein präziser Assistent. Antworte auf Deutsch.\\n"
f"AUFTRAG:\\n{prm['prompt']}\\n"