Browse Source

Improvements

marinofaggiana 4 năm trước cách đây
mục cha
commit
d792fd9230

+ 8 - 0
iOSClient/Main/CCMain.m

@@ -2410,8 +2410,16 @@
     
     if (localFile) {
         [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_remove_local_file_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+            tableMetadata *metadataLivePhoto = [[NCUtility sharedInstance] isLivePhotoWithMetadata:metadata];
+            
             [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
             [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId] error:nil];
+            
+            if (metadataLivePhoto) {
+                [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadataLivePhoto.ocId]];
+                [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadataLivePhoto.ocId] error:nil];
+            }
+            
             [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];
         }]];
     }

+ 10 - 1
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -479,12 +479,21 @@ extension CCMain {
                         icon: CCGraphics.changeThemingColorImage(UIImage(named: "offline"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                         action: { menuAction in
                             if (localFile == nil || !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView)) {
+                                
                                 metadata.session = k_download_session
                                 metadata.sessionError = ""
                                 metadata.sessionSelector = selectorLoadOffline
                                 metadata.status = Int(k_metadataStatusWaitDownload)
-
                                 NCManageDatabase.sharedInstance.addMetadata(metadata)
+                                
+                                if let metadataLivePhoto = NCUtility.sharedInstance.isLivePhoto(metadata: metadata) {
+                                    metadataLivePhoto.session = k_download_session
+                                    metadataLivePhoto.sessionError = ""
+                                    metadataLivePhoto.sessionSelector = selectorLoadOffline
+                                    metadataLivePhoto.status = Int(k_metadataStatusWaitDownload)
+                                    NCManageDatabase.sharedInstance.addMetadata(metadataLivePhoto)
+                                }
+                                
                                 NCMainCommon.sharedInstance.reloadDatasource(ServerUrl: self.serverUrl, ocId: metadata.ocId, action: k_action_MOD)
                                 appDelegate.startLoadAutoDownloadUpload()
                             } else {

BIN
iOSClient/Supporting Files/bg_BG.lproj/Localizable.strings


+ 1 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -286,7 +286,7 @@
 "_crashservice_title_"          = "Disable crash reporter";
 "_crashservice_alert_"          = "This option requires a restart of the app to take effect";
 "_upload_mov_livephoto_"        = "Live Photo";
-"_upload_mov_livephoto_footer_" = "\"Live Photo\" will save, when possible, Live Photo video";
+"_upload_mov_livephoto_footer_" = "\"Live Photo\" will save, when possible, Live Photo video and hide the mov file part";
 
 // Login
 

BIN
iOSClient/Supporting Files/fr.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/sk-SK.lproj/Localizable.strings


BIN
iOSClient/Supporting Files/vi.lproj/Localizable.strings