marinofaggiana 5 жил өмнө
parent
commit
91f6286180

+ 4 - 4
File Provider Extension/FileProviderEnumerator.swift

@@ -253,10 +253,10 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
                         NCManageDatabase.sharedInstance.addMetadatas(files: files!, account: account, serverUrl: serverUrl, removeFirst: true)
                          
                         if metadatasInDownload != nil {
-                            _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload!)
+                            NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload!)
                         }
                         if metadatasInUpload != nil {
-                            _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInUpload!)
+                            NCManageDatabase.sharedInstance.addMetadatas(metadatasInUpload!)
                         }
                     }
                     completionHandler()
@@ -288,10 +288,10 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
                     let metadatasInDownload = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", account, serverUrl, k_metadataStatusWaitDownload, k_metadataStatusInDownload, k_metadataStatusDownloading, k_metadataStatusDownloadError), sorted: nil, ascending: false)
                     let metadatasInUpload = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", account, serverUrl, k_metadataStatusWaitUpload, k_metadataStatusInUpload, k_metadataStatusUploading, k_metadataStatusUploadError), sorted: nil, ascending: false)
                     if metadatasInDownload != nil {
-                        _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload!)
+                        NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload!)
                     }
                     if metadatasInUpload != nil {
-                        _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInUpload!)
+                        NCManageDatabase.sharedInstance.addMetadatas(metadatasInUpload!)
                     }
                 }
                 

+ 1 - 1
Share/NCSelectDestination.m

@@ -246,7 +246,7 @@
             
             // reinsert metadatas in Download
             if (metadatasInDownload) {
-                (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
+                [[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
             }
                                
         } else {

+ 1 - 1
iOSClient/AutoUpload/NCAutoUpload.m

@@ -469,7 +469,7 @@
     // Insert all assets (Full) in tableQueueUpload
     if ([selector isEqualToString:selectorUploadAutoUploadAll] && [metadataFull count] > 0) {
     
-        (void)[[NCManageDatabase sharedInstance] addMetadatas:metadataFull];
+        [[NCManageDatabase sharedInstance] addMetadatas:metadataFull];
         
         // Update icon badge number
         dispatch_async(dispatch_get_main_queue(), ^{

+ 1 - 0
iOSClient/Database/NCManageDatabase.swift

@@ -1907,6 +1907,7 @@ class NCManageDatabase: NSObject {
         return tableMetadata.init(value: metadata)
     }
     
+    @discardableResult
     @objc func addMetadatas(_ metadatas: [tableMetadata]) -> [tableMetadata]? {
         
         var directoryToClearDate = [String:String]()

+ 3 - 3
iOSClient/Main/CCMain.m

@@ -1145,8 +1145,8 @@
         
     } else {
         
-        (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatas];
-        (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasMOV];
+        [[NCManageDatabase sharedInstance] addMetadatas:metadatas];
+        [[NCManageDatabase sharedInstance] addMetadatas:metadatasMOV];
         
         [appDelegate startLoadAutoDownloadUpload];
         [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];
@@ -1232,7 +1232,7 @@
     }
     // reinsert metadatas in Download
     if (metadatasInDownload) {
-        (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
+        [[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload];
     }
     
     // File is changed ??

+ 9 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -120,6 +120,7 @@ import Foundation
     }
     
     @IBAction func buttonContinueTouch(_ sender: Any) {
+        
         for metadata in metadatasConflict {
             
             // new filename + num
@@ -131,10 +132,18 @@ import Foundation
             // remove
             } else if metadatasConflictAlreadyExistingFiles.contains(metadata.ocId) {
                 
+                
+                
             } else {
                 return
             }
         }
+        
+        NCManageDatabase.sharedInstance.addMetadatas(metadatas)
+        NCManageDatabase.sharedInstance.addMetadatas(metadatasConflict)
+        NCManageDatabase.sharedInstance.addMetadatas(metadatasMOV)
+        
+        appDelegate.startLoadAutoDownloadUpload()
     }
 }
 

+ 2 - 2
iOSClient/Select/NCSelect.swift

@@ -768,11 +768,11 @@ extension NCSelect {
                 NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND status == %d", self.appDelegate.activeAccount ,self.serverUrl, k_metadataStatusNormal))
                 NCManageDatabase.sharedInstance.setDateReadDirectory(serverUrl: self.serverUrl, account: self.appDelegate.activeAccount)
                 
-                _ = NCManageDatabase.sharedInstance.addMetadatas(metadatas as! [tableMetadata])
+                NCManageDatabase.sharedInstance.addMetadatas(metadatas as! [tableMetadata])
                 
                 if let metadatasInDownload = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", self.appDelegate.activeAccount ,self.serverUrl, k_metadataStatusWaitDownload, k_metadataStatusInDownload, k_metadataStatusDownloading, k_metadataStatusDownloadError), sorted: nil, ascending: false) {
                     
-                    _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload)
+                    NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload)
                 }
                 
             } else if errorCode != 0 {

+ 2 - 2
iOSClient/Synchronize/CCSynchronize.m

@@ -196,7 +196,7 @@
         }
         
         if ([addMetadatas count] > 0)
-            (void)[[NCManageDatabase sharedInstance] addMetadatas:addMetadatas];
+            [[NCManageDatabase sharedInstance] addMetadatas:addMetadatas];
         
         if ([metadatasForVerifyChange count] > 0)
             [self verifyChangeMedatas:metadatasForVerifyChange serverUrl:serverUrl account:account withDownload:YES];
@@ -314,7 +314,7 @@
         [metadataToAdd addObject:metadata];
     }
     
-    (void)[[NCManageDatabase sharedInstance] addMetadatas:metadataToAdd];
+    [[NCManageDatabase sharedInstance] addMetadatas:metadataToAdd];
     
     for (NSString *serverUrl in serverUrlToReload) {
         [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:serverUrl ocId:nil action:k_action_NULL];