|
@@ -691,7 +691,9 @@ import Queuer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @objc func searchFiles(urlBase: String, user: String, dataFileXML: String, literal: String, completion: @escaping (_ account: String, _ metadatas: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
|
|
|
+ //MARK: - WebDav Search
|
|
|
+
|
|
|
+ @objc func searchFiles(urlBase: String, user: String, literal: String, completion: @escaping (_ account: String, _ metadatas: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
|
|
|
|
|
|
NCCommunication.shared.searchLiteral(serverUrl: urlBase, depth: "infinity", literal: literal, showHiddenFiles: CCUtility.getShowHiddenFiles(), user: user) { (account, files, errorCode, errorDescription) in
|
|
|
|
|
@@ -875,6 +877,11 @@ import Queuer
|
|
|
if metadata.directory {
|
|
|
NCManageDatabase.sharedInstance.deleteDirectoryAndSubDirectory(serverUrl: CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName), account: metadata.account)
|
|
|
}
|
|
|
+ } else {
|
|
|
+
|
|
|
+ #if !EXTENSION
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
self.NotificationPost(name: k_notificationCenter_deleteFile, userInfo: ["metadata": metadata, "onlyLocal": false, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
@@ -907,6 +914,10 @@ import Queuer
|
|
|
|
|
|
if errorCode == 0 && metadata.account == account {
|
|
|
NCManageDatabase.sharedInstance.setMetadataFavorite(ocId: metadata.ocId, favorite: favorite)
|
|
|
+ } else {
|
|
|
+ #if !EXTENSION
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
self.NotificationPost(name: k_notificationCenter_favoriteFile, userInfo: ["metadata": metadata, "favorite": favorite, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
@@ -1013,6 +1024,10 @@ import Queuer
|
|
|
try FileManager.default.moveItem(atPath: atPath, toPath: toPath)
|
|
|
} catch { }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ #if !EXTENSION
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
self.NotificationPost(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
@@ -1056,6 +1071,10 @@ import Queuer
|
|
|
}
|
|
|
|
|
|
NCManageDatabase.sharedInstance.moveMetadata(ocId: metadata.ocId, serverUrlTo: serverUrlTo)
|
|
|
+ } else {
|
|
|
+ #if !EXTENSION
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
guard let metadataNew = NCManageDatabase.sharedInstance.getMetadataFromOcId(metadata.ocId) else { return }
|
|
@@ -1093,6 +1112,11 @@ import Queuer
|
|
|
|
|
|
NCCommunication.shared.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite) { (account, errorCode, errorDescription) in
|
|
|
|
|
|
+ if errorCode != 0 {
|
|
|
+ #if !EXTENSION
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ #endif
|
|
|
+ }
|
|
|
self.NotificationPost(name: k_notificationCenter_copyFile, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
|
}
|
|
|
}
|