marinofaggiana 5 年之前
父節點
當前提交
ce12bb4dc8

+ 0 - 8
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -58,14 +58,6 @@ extension NCDetailNavigationController {
                     
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_delete_", comment: ""), style: .default) { (action:UIAlertAction) in
                         
-                        // Live Data ? remove MOV
-                        if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio {
-                        
-                            if let metadataMov = NCUtility.sharedInstance.hasMOV(metadata: metadata) {
-                                NCNetworking.sharedInstance.deleteMetadata(metadataMov, user: self.appDelegate.activeUser, userID: self.appDelegate.activeUserID, password: self.appDelegate.activePassword, url: self.appDelegate.activeUrl) { (errorCode, errorDescription) in }
-                            }
-                        }
-                        
                         NCNetworking.sharedInstance.deleteMetadata(metadata, user: self.appDelegate.activeUser, userID: self.appDelegate.activeUserID, password: self.appDelegate.activePassword, url: self.appDelegate.activeUrl) { (errorCode, errorDescription) in }
                     })
                     

+ 1 - 1
iOSClient/Main/NCDetailViewController.swift

@@ -301,7 +301,7 @@ class NCDetailViewController: UIViewController {
                     viewerImageViewController?.reloadContentViews()
                 }
                 
-                setProgressBar()
+                progress(0)
             }
         }
     }

+ 12 - 1
iOSClient/Networking/NCNetworking.swift

@@ -254,7 +254,18 @@ import NCCommunication
         if directory != nil && directory?.e2eEncrypted == true {
             self.deleteMetadataE2EE(metadata, directory: directory!, user: user, userID: userID, password: password, url: url, completion: completion)
         } else {
-            self.deleteMetadataPlain(metadata, completion: completion)
+            // Verify Live Photo
+            if let metadataMov = NCUtility.sharedInstance.hasMOV(metadata: metadata) {
+                self.deleteMetadataPlain(metadataMov) { (errorCode, errorDescription) in
+                    if errorCode == 0 {
+                        self.deleteMetadataPlain(metadata, completion: completion)
+                    } else {
+                        completion(errorCode, errorDescription)
+                    }
+                }
+            } else {
+                self.deleteMetadataPlain(metadata, completion: completion)
+            }
         }
     }