diff --git a/winnow/cli.py b/winnow/cli.py index 55391a0..f568f91 100644 --- a/winnow/cli.py +++ b/winnow/cli.py @@ -109,7 +109,7 @@ def _handle_duplicate_people(people: list[dict]) -> list[dict]: ) # Return deduplicated list — keep only the largest per name so that # downstream job creation never runs two jobs for the same Frigate folder. - return [p for p in people if p["id"] not in skip_ids] + return [p for p in people if p.get("id") not in skip_ids] # Auto-merge: survivor = largest asset count, rest merge into it inside Immich merged_any = False @@ -141,7 +141,7 @@ def _handle_duplicate_people(people: list[dict]) -> list[dict]: " — possible transient error or expired API key;" " proceeding with pre-merge list. Check IMMICH_API_KEY if this recurs." ) - return [p for p in people if p["id"] not in skip_ids] + return [p for p in people if p.get("id") not in skip_ids] # Filter out the smaller duplicate from any group whose merge failed — those # IDs still exist in Immich and would produce two jobs for the same folder. # IDs from groups that merged successfully are already gone from Immich, so diff --git a/winnow/upload_tracker.py b/winnow/upload_tracker.py index 39e57a3..04ead4c 100644 --- a/winnow/upload_tracker.py +++ b/winnow/upload_tracker.py @@ -444,10 +444,10 @@ def reset_person(person_name: str) -> None: person_ids = set(_get_ids(tracker_entry)) if person_ids and flat_key in data and not isinstance(data[flat_key], list): logger.warning( - "reset_person: %s has unexpected type for %s (%s) — clearing corrupt flat-list", + "reset_person: %s has unexpected type for %s (%s) — skipping flat-list cleanup;" + " all persons' legacy IDs in this field are unaffected but unreadable", filename, flat_key, type(data[flat_key]).__name__, ) - data[flat_key] = [] elif person_ids and flat_key in data: data[flat_key] = sorted(set(data[flat_key]) - person_ids) _save(filename, data)