π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob] Support for showing recent first in discover
Neeraj Guptafd29a982cc93
diff --git a/mobile/lib/models/ml/discover/prompt.dart b/mobile/lib/models/ml/discover/prompt.dartindex d5bc4f5cb0..08a652483e 100644--- a/mobile/lib/models/ml/discover/prompt.dart+++ b/mobile/lib/models/ml/discover/prompt.dart@@ -7,7 +7,7 @@ class Prompt {final double minSize;final String title;final bool showVideo;- final bool bestFirst;+ final bool recentFirst;// fromJsonPrompt.fromJson(Map<String, dynamic> json)@@ -17,6 +17,6 @@ class Prompt {minSize = json['minSize'] ?? json['minimumSize'] ?? 0.0,position = json['position'] ?? 0,title = json['title'],- bestFirst = json['bestFirst'] ?? false,+ recentFirst = json['recentFirst'] ?? false,showVideo = json['showVideo'] ?? true;}diff --git a/mobile/lib/services/magic_cache_service.dart b/mobile/lib/services/magic_cache_service.dartindex 4aa5c12f2e..0fd49d68e1 100644--- a/mobile/lib/services/magic_cache_service.dart+++ b/mobile/lib/services/magic_cache_service.dart@@ -52,6 +52,7 @@ class MagicCache {extension MagicCacheServiceExtension on MagicCache {Future<GenericSearchResult?> toGenericSearchResult(List<EnteFile> enteFilesInMagicCache,+ bool showRecentFirst,) async {if (enteFilesInMagicCache.isEmpty) {return null;@@ -66,6 +67,7 @@ extension MagicCacheServiceExtension on MagicCache {MagicResultScreen(enteFilesInMagicCache,name: title,+ enableGrouping: showRecentFirst,heroTag: GenericSearchResult(ResultType.magic,title,@@ -244,6 +246,7 @@ class MagicCacheService {for (MagicCache magicCache in magicCaches) {final genericSearchResult = await magicCache.toGenericSearchResult(magicIdToFiles[magicCache.title]!,+ (promptMap[magicCache.title]?.recentFirst ?? false),);if (genericSearchResult != null) {genericSearchResults.add(genericSearchResult);diff --git a/mobile/lib/ui/viewer/search/result/magic_result_screen.dart b/mobile/lib/ui/viewer/search/result/magic_result_screen.dartindex 9a048b1820..2c58e9a5e7 100644--- a/mobile/lib/ui/viewer/search/result/magic_result_screen.dart+++ b/mobile/lib/ui/viewer/search/result/magic_result_screen.dart@@ -20,6 +20,7 @@ class MagicResultScreen extends StatefulWidget {final List<EnteFile> files;final String name;final String heroTag;+ final bool enableGrouping;static const GalleryType appBarType = GalleryType.magic;static const GalleryType overlayType = GalleryType.magic;@@ -27,6 +28,7 @@ class MagicResultScreen extends StatefulWidget {const MagicResultScreen(this.files, {required this.name,+ this.enableGrouping = false,this.heroTag = "",super.key,});@@ -46,6 +48,7 @@ class _MagicResultScreenState extends State<MagicResultScreen> {void initState() {super.initState();files = widget.files;+ _enableGrouping = widget.enableGrouping;_filesUpdatedEvent =Bus.instance.on<LocalPhotosUpdatedEvent>().listen((event) {if (event.type == EventType.deletedFromDevice ||