fix: metadata enrichment fails silently — use 'or {}' for None metadata
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled

.get('metadata', {}) returns None when key exists with None value,
causing 'NoneType has no attribute copy' in MetadataEnricher.
Enrichment now works: 17/20 anime + 15/28 series results show synopsis.
This commit is contained in:
root
2026-03-28 00:26:45 +00:00
parent 89291bddde
commit 0e27d73d07
+5 -5
View File
@@ -170,8 +170,8 @@ async def search_anime_unified(
if len(results[pid]) <= 15:
enrichment_tasks.append(
enricher.enrich_metadata(
item_dict.get("metadata", {}),
item_dict.get("title", ""),
item_dict.get("metadata") or {},
item_dict.get("title") or "",
url,
)
)
@@ -277,9 +277,9 @@ async def search_series_unified(
if isinstance(item, dict):
enrichment_tasks.append(
enricher.enrich_metadata(
item.get("metadata", {}),
item.get("title", ""),
item.get("url", ""),
item.get("metadata") or {},
item.get("title") or "",
item.get("url") or "",
)
)
enrichment_mapping.append((provider_id, idx))