#22 NI: Deduplizierung (Server liefert manche Treffer doppelt)

This commit is contained in:
Dotty Dotter 2026-04-10 17:40:46 +02:00
parent edcb4e9c76
commit 521d940611

View File

@ -464,6 +464,7 @@ class PortalaAdapter(ParlamentAdapter):
- WEV08[0].1 PDF-URL (alternativ)
"""
results: list[Drucksache] = []
seen: set[str] = set()
for m in self._RE_JSON_COMMENT.finditer(html):
try:
@ -517,6 +518,11 @@ class PortalaAdapter(ParlamentAdapter):
typ=typ or "Antrag",
)
# Deduplizierung (NI liefert manche Treffer doppelt)
if drucksache in seen:
continue
seen.add(drucksache)
# Client-seitig Antrag-Filter (wie bei allen Adaptern)
if "antrag" not in (doc.typ or "").lower():
continue