Browse Source

improvements

Marino Faggiana 7 năm trước cách đây
mục cha
commit
8dbc450cb7
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      PickerFileProvider/FileProvider.swift

+ 6 - 3
PickerFileProvider/FileProvider.swift

@@ -127,10 +127,13 @@ class FileProvider: NSFileProviderExtension, CCNetworkingDelegate {
             }
         }
         
-        //TODO: verifica se esiste già in coda
+        // verifica se esiste già in coda
         
-        CCNetworking.shared().settingDelegate(self)
-        CCNetworking.shared().uploadFile(fileName, serverUrl: serverUrl, cryptated: false, onlyPlist: false, session: k_upload_session_foreground, taskStatus: Int(k_taskStatusSuspend), selector: nil, selectorPost: nil, errorCode: 0, delegate: self)
+        if NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileName == %@ AND serverUrl == %@ AND session == %@", fileName, serverUrl!, k_upload_session_foreground)) == nil {
+            
+            CCNetworking.shared().settingDelegate(self)
+            CCNetworking.shared().uploadFile(fileName, serverUrl: serverUrl, cryptated: false, onlyPlist: false, session: k_upload_session_foreground, taskStatus: Int(k_taskStatusSuspend), selector: nil, selectorPost: nil, errorCode: 0, delegate: self)
+        }
         
         self.stopProvidingItem(at: url)
     }