|
@@ -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)
|
|
|
}
|