Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] restrict scheduled clusters to top N

Priyanshu Dangaredd5769a0c81f
diff --git a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
index c69ef86d9d..539554a19e 100644
--- a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
+++ b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
@@ -926,6 +926,7 @@ class MemoryLaneService {
final isInCooldown =
nowMicros - entry.value.beginShowingAt < cooldownMicros;
if (timeline == null ||
+ (timeline.isCluster && !_topNClusters.contains(timeline.personId)) ||
!timeline.isEligible ||
timeline.entries.isEmpty ||
!isInCooldown) {
@@ -949,6 +950,7 @@ class MemoryLaneService {
(t) =>
t.isEligible &&
t.entries.isNotEmpty &&
+ (!t.isCluster || _topNClusters.contains(t.personId)) &&
(!cache.memoriesStripSchedule.containsKey(t.personId) ||
invalid.contains(t.personId)),
);