diff --git a/src/report_generator.py b/src/report_generator.py index 1949a2c..a1e44d0 100644 --- a/src/report_generator.py +++ b/src/report_generator.py @@ -26,10 +26,15 @@ LOGO_PATH = Path(__file__).parent / "static" / "favicon.svg" FC_STATUS_LABELS = { - "confirmed": "Bestätigt", - "unconfirmed": "Unbestätigt", - "disputed": "Umstritten", - "false": "Falsch", + # 1:1 vom Monitor-Frontend (components.js) — konsistent zum UI. + "confirmed": "Bestätigt", + "unconfirmed": "Unbestätigt", + "contradicted": "Widerlegt", + "developing": "Unklar", + "established": "Gesichert", + "disputed": "Umstritten", + "unverified": "Ungeprüft", + "false": "Falsch", # Legacy-Fallback } @@ -709,7 +714,7 @@ async def generate_pdf( ), lagebild_timestamp=(incident.get("updated_at") or "")[:16].replace("T", " "), sources=_prepare_sources(incident)[:30] if scope == "report" else _prepare_sources(incident), - fact_checks=_prepare_fact_checks(fact_checks[:20] if scope == "report" else fact_checks), + fact_checks=_prepare_fact_checks(fact_checks), source_stats=_prepare_source_stats(articles)[:20] if scope == "report" else _prepare_source_stats(articles), timeline=_prepare_timeline(articles) if scope == "full" else [], articles=articles if scope == "full" else [], diff --git a/src/routers/incidents.py b/src/routers/incidents.py index ff64a0a..2173f91 100644 --- a/src/routers/incidents.py +++ b/src/routers/incidents.py @@ -1165,8 +1165,18 @@ async def export_incident( ) snapshots = [dict(r) for r in await cursor.fetchall()] - # Executive Summary (KI-generiert, gecacht) - exec_summary = incident.get("executive_summary") + # Zusammenfassung fuer den Export: + # - Bei Adhoc-Lagen primaer "Neueste Entwicklungen" (latest_developments) als Markdown-Bullets, + # weil Live-Monitoring von Aktualitaet lebt. + # - Fallback (oder bei Research): Executive Summary (KI-generiert, gecacht). + is_adhoc = (incident.get("type") or "adhoc") != "research" + latest_dev = (incident.get("latest_developments") or "").strip() + exec_summary = None + if is_adhoc and latest_dev: + from report_generator import _markdown_to_html as _md_to_html + exec_summary = _md_to_html(latest_dev) + if not exec_summary: + exec_summary = incident.get("executive_summary") if not exec_summary: summary_text = incident.get("summary") or "" exec_summary = await generate_executive_summary(summary_text)