From 7b83dbd1146892f535c40d9c629c0a1ccf18efcf Mon Sep 17 00:00:00 2001 From: sudolulo Date: Thu, 11 Jun 2026 12:51:59 -0400 Subject: [PATCH] fix nonetype error --- if_curator/cli.py | 6 ++++++ if_curator/image_processing.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/if_curator/cli.py b/if_curator/cli.py index aa0f038..4821ac2 100644 --- a/if_curator/cli.py +++ b/if_curator/cli.py @@ -473,11 +473,17 @@ def _enrich_asset_with_face_data(asset: dict, person: dict) -> dict: if face_data is None: logger.debug(f"No face data returned for {person.get('name')} in asset {asset.get('id')}") + # Clean any None entries from the people list (can come from Immich API) + if "people" in asset: + asset["people"] = [p for p in asset["people"] if p is not None] return asset # Skip zero-area bounding boxes (face detection failed or no face found) if face_data.bbox == (0, 0, 0, 0): logger.debug(f"Zero-area bounding box for {person.get('name')} in asset {asset.get('id')}") + # Clean any None entries from the people list (can come from Immich API) + if "people" in asset: + asset["people"] = [p for p in asset["people"] if p is not None] return asset face_info = { diff --git a/if_curator/image_processing.py b/if_curator/image_processing.py index df9c72c..b422798 100644 --- a/if_curator/image_processing.py +++ b/if_curator/image_processing.py @@ -75,6 +75,8 @@ def process_face_mode( # Find face metadata for this person face_info = None for p in asset.get("people", []): + if p is None: + continue if p["id"] == person["id"] and (faces := p.get("faces")): face_info = faces[0] break