Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] dont recompute assigned clusters again in memory lane service

Priyanshu Dangare80faca740701
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 c7407bd21d..b6caac547e 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
@@ -113,19 +113,19 @@ class MemoryLaneService {
schedulePersonRecompute(person.remoteID, force: force);
}
if (flagService.internalUser) {
- _topNClusters = {};
- final cache = await _cacheService.getCache();
- for (final timeline in cache.allTimelines) {
- if (timeline.isCluster) {
- _topNClusters.add(timeline.personId);
- }
- }
final assigned = <String>{};
for (final person in persons) {
for (final cluster in person.data.assigned) {
assigned.add(cluster.id);
}
}
+ _topNClusters = {};
+ final cache = await _cacheService.getCache();
+ for (final timeline in cache.allTimelines) {
+ if (timeline.isCluster && !assigned.contains(timeline.personId)) {
+ _topNClusters.add(timeline.personId);
+ }
+ }
_topNClusters.addAll(await _mlDataDB.getClustersForMemoryLane(assigned));
for (final cluster in _topNClusters) {
schedulePersonRecompute(cluster, isCluster: true, force: force);