Explorar el Código

Merge pull request #795 from ente-io/release_reset_ignore_fix

Fix logic for computing reset ignore flag on droid
Neeraj Gupta hace 2 años
padre
commit
51afc7bf7a

+ 8 - 0
lib/services/ignored_files_service.dart

@@ -99,6 +99,14 @@ class IgnoredFilesService {
     );
   }
 
+  String? getIgnoredIDForFile(File file) {
+    return _getIgnoreID(
+      file.localID,
+      file.deviceFolder,
+      file.title,
+    );
+  }
+
   // _getIgnoreID will return null if don't have sufficient information
   // to ignore the file based on the platform. Uploads from web or files shared to
   // end usually don't have local id.

+ 7 - 3
lib/ui/viewer/gallery/device_folder_page.dart

@@ -195,12 +195,16 @@ class _BackupHeaderWidgetState extends State<BackupHeaderWidget> {
   ) async {
     final List<File> deviceCollectionFiles = await filesInDeviceCollection;
 
-    final localIDsOfFiles = <String>{};
+    final ignoredIdsForFile = <String>{};
     for (File file in deviceCollectionFiles) {
-      localIDsOfFiles.add(file.localID!);
+      final String? ignoreID =
+          IgnoredFilesService.instance.getIgnoredIDForFile(file);
+      if (ignoreID != null) {
+        ignoredIdsForFile.add(ignoreID);
+      }
     }
     final ignoredFiles = await IgnoredFilesService.instance.ignoredIDs;
-    return ignoredFiles.intersection(localIDsOfFiles).isNotEmpty;
+    return ignoredFiles.intersection(ignoredIdsForFile).isNotEmpty;
   }
 }
 

+ 1 - 1
pubspec.yaml

@@ -12,7 +12,7 @@ description: ente photos application
 # Read more about iOS versioning at
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 
-version: 0.7.7+407
+version: 0.7.8+408
 
 environment:
   sdk: '>=2.17.0 <3.0.0'