💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Lower criteria to minimum 5 consecutive years
laurenspriemaede38628542
diff --git a/mobile/apps/photos/.docs/face_timeline_spec.md b/mobile/apps/photos/.docs/face_timeline_spec.mdindex 6b01cdeff0..2b07ca820f 100644--- a/mobile/apps/photos/.docs/face_timeline_spec.md+++ b/mobile/apps/photos/.docs/face_timeline_spec.md@@ -5,7 +5,7 @@ Deliver an on-device, auto-playing “faces timeline” for eligible named peopl### Eligibility & Precomputation- Run background precomputation per person after ML syncs or people data changes.-- Skip people marked ignored/hidden or lacking ≥7 distinct calendar years that each contribute ≥4 faces (based on file `creationTime`); a year only counts toward eligibility if it independently meets that four-face threshold.+- Skip people marked ignored/hidden or lacking ≥5 distinct calendar years that each contribute ≥4 faces (based on file `creationTime`); a year only counts toward eligibility if it independently meets that four-face threshold.- Group faces by year, sort chronologically, and select four samples spread across the year (prefer quarterly spacing; gracefully accept uneven distributions).- Store the resulting ordered face list with metadata (faceID, fileID, creationTime, optional crop bytes) in a local cache keyed by personID.- Persist the ordered timeline metadata for all people in a single JSON cache (e.g., `faces_timeline/cache.json`) that maps each eligible `personID` to the face ordering, timestamps, and auxiliary playback data; continue to rely on the existing face thumbnail cache for the actual crop bytes.diff --git a/mobile/apps/photos/lib/services/faces_timeline/faces_timeline_service.dart b/mobile/apps/photos/lib/services/faces_timeline/faces_timeline_service.dartindex 288f76fbca..02b4b0e256 100644--- a/mobile/apps/photos/lib/services/faces_timeline/faces_timeline_service.dart+++ b/mobile/apps/photos/lib/services/faces_timeline/faces_timeline_service.dart@@ -29,7 +29,7 @@ class FacesTimelineService {static final FacesTimelineService instance = FacesTimelineService._internal();- static const _minimumYears = 7;+ static const _minimumYears = 5;static const _minimumFacesPerYear = 4;static const _recomputeCooldown = Duration(hours: 24);diff --git a/mobile/apps/photos/test/services/faces_timeline/timeline_selector_test.dart b/mobile/apps/photos/test/services/faces_timeline/timeline_selector_test.dartindex bf37be2f11..6248a8127c 100644--- a/mobile/apps/photos/test/services/faces_timeline/timeline_selector_test.dart+++ b/mobile/apps/photos/test/services/faces_timeline/timeline_selector_test.dart@@ -21,9 +21,9 @@ Map<String, dynamic> _buildFace(void main() {group("Faces timeline selection", () {- test("returns ready when at least seven eligible years are present", () {+ test("returns ready when at least five eligible years are present", () {final faces = <Map<String, dynamic>>[];- for (int year = 2010; year < 2017; year++) {+ for (int year = 2010; year < 2015; year++) {for (int index = 0; index < 5; index++) {faces.add(_buildFace(@@ -37,17 +37,17 @@ void main() {final result = selectTimelineEntriesTask({"faces": faces,- "minYears": 7,+ "minYears": 5,"minFaces": 4,});expect(result["status"], equals("ready"));final years = (result["years"] as List<dynamic>).cast<int>();- expect(years, equals(List<int>.generate(7, (i) => 2010 + i)));+ expect(years, equals(List<int>.generate(5, (i) => 2010 + i)));final entries =(result["entries"] as List<dynamic>).cast<Map<String, dynamic>>();- expect(entries.length, equals(28));+ expect(entries.length, equals(20));final faceIds = entries.map((entry) => entry["faceId"]).toSet();expect(faceIds.length, equals(entries.length));@@ -58,9 +58,9 @@ void main() {}});- test("returns ineligible when fewer than seven years qualify", () {+ test("returns ineligible when fewer than five years qualify", () {final faces = <Map<String, dynamic>>[];- for (int year = 2011; year < 2017; year++) {+ for (int year = 2011; year < 2015; year++) {for (int index = 0; index < 4; index++) {faces.add(_buildFace(@@ -74,12 +74,12 @@ void main() {final result = selectTimelineEntriesTask({"faces": faces,- "minYears": 7,+ "minYears": 5,"minFaces": 4,});expect(result["status"], equals("ineligible"));- expect(result["eligibleYearCount"], equals(6));+ expect(result["eligibleYearCount"], equals(4));expect(result["entries"], isNull);});