π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Better frequency for people type
laurenspriema6b29525d297
diff --git a/mobile/apps/photos/lib/models/memories/memories_cache.dart b/mobile/apps/photos/lib/models/memories/memories_cache.dartindex 622c3b8485..1c1c01b5bc 100644--- a/mobile/apps/photos/lib/models/memories/memories_cache.dart+++ b/mobile/apps/photos/lib/models/memories/memories_cache.dart@@ -10,13 +10,11 @@ import "package:photos/models/memories/smart_memory_constants.dart";import "package:photos/models/memories/trip_memory.dart";const kPersonShowTimeout = Duration(days: 16 * kMemoriesUpdateFrequencyDays);-const kPersonAndTypeShowTimeout = Duration(days: 7 * 26);const kClipShowTimeout = Duration(days: 3 * 10);const kTripShowTimeout = Duration(days: 7 * 25);final maxShowTimeout = [kPersonShowTimeout,- kPersonAndTypeShowTimeout,kTripShowTimeout,].reduce((value, element) => value > element ? value : element) *3;diff --git a/mobile/apps/photos/lib/services/smart_memories_service.dart b/mobile/apps/photos/lib/services/smart_memories_service.dartindex 9875df1402..9583bbc38d 100644--- a/mobile/apps/photos/lib/services/smart_memories_service.dart+++ b/mobile/apps/photos/lib/services/smart_memories_service.dart@@ -716,6 +716,8 @@ class SmartMemoriesService {max(1, amountOfPersons) * kMemoriesUpdateFrequencyDays,),);+ final shownPersonAndTypeTimeout =+ Duration(days: shownPersonTimeout.inDays * 2);peopleRotationLoop:for (final personID in orderedImportantPersonsID) {for (final memory in memoryResults) {@@ -733,6 +735,8 @@ class SmartMemoriesService {}if (personToMemories[personID] == null) continue peopleRotationLoop;int added = 0;+ final amountOfMemoryTypesForPerson = personToMemories[personID]!.length;+ final bool manyMemoryTypes = amountOfMemoryTypesForPerson > 2;potentialMemoryLoop:for (final memoriesForCategory in personToMemories[personID]!.values) {PeopleMemory potentialMemory = memoriesForCategory.first;@@ -755,8 +759,10 @@ class SmartMemoriesService {final shownTypeDate =DateTime.fromMicrosecondsSinceEpoch(shownLog.lastTimeShown);final bool seenPersonTypeRecently =- currentTime.difference(shownTypeDate) < kPersonAndTypeShowTimeout;- if (seenPersonTypeRecently) continue potentialMemoryLoop;+ currentTime.difference(shownTypeDate) < shownPersonAndTypeTimeout;+ if (manyMemoryTypes && seenPersonTypeRecently) {+ continue potentialMemoryLoop;+ }}memoryResults.add(potentialMemory);added++;