Skip to main content

Module album_suggestions

Module album_suggestions 

Source
Expand description

Album suggestion detection service.

Analyses photo metadata (location, time, faces) to propose trip and event albums that the user can accept, dismiss, or ignore.

Structs§

DetectedSuggestion
A detected suggestion before persistence.
SuggestionDiagnostics

Functions§

compute_fingerprint
Compute a stable fingerprint from a sorted set of photo IDs. Uses std DefaultHasher for speed (no crypto needed).
detect_events
Detect event suggestions via a 4-hour sliding window. An event is a burst of >= 8 photos separated by <= 4 hours from their neighbours, with a signal check (faces or single-location).
detect_gatherings
A “gathering” is a 1–2 day window with ≥ 8 photos that contain at least 2 distinct named-or-unnamed face clusters. The intent is to catch family weekends, parties, and outings on libraries that have no location metadata at all (old phones, scanned DSLR exports).
detect_home_city
Determine the user’s “home city” — the city with the most distinct photo-weeks. Returns (city, country, centroid_lat, centroid_lng) or None.
detect_suggestions
Run the full suggestion detection pipeline: trips then events. Newly detected suggestions that don’t match existing fingerprints are persisted to the database.
detect_suggestions_with_diagnostics
detect_suggestions_with_diagnostics_cancel
detect_trips
Detect complete journeys rather than independent city visits.
haversine_km
Haversine distance in kilometres between two lat/lng pairs.
pick_cover
Pick the best cover photo from a list of IDs. User favourites and the existing duplicate/burst quality ranking lead; faces and landscape framing break ties.