|
@@ -267,7 +267,7 @@ import Queuer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @objc func download(metadata: tableMetadata, activityIndicator: Bool, selector: String, completion: @escaping (_ errorCode: Int)->()) {
|
|
|
+ @objc func download(metadata: tableMetadata, selector: String, completion: @escaping (_ errorCode: Int)->()) {
|
|
|
|
|
|
let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
|
|
|
let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileName)!
|
|
@@ -280,10 +280,6 @@ import Queuer
|
|
|
|
|
|
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, session: NCCommunicationCommon.shared.sessionIdentifierDownload, sessionError: "", sessionSelector: selector, sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusInDownload)
|
|
|
|
|
|
- if activityIndicator {
|
|
|
- NCUtility.shared.startActivityIndicator(backgroundView: nil, blurEffect: true)
|
|
|
- }
|
|
|
-
|
|
|
NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, requestHandler: { (request) in
|
|
|
|
|
|
self.downloadRequest[fileNameLocalPath] = request
|
|
@@ -299,10 +295,6 @@ import Queuer
|
|
|
|
|
|
}) { (account, etag, date, length, allHeaderFields, error, errorCode, errorDescription) in
|
|
|
|
|
|
- if activityIndicator {
|
|
|
- NCUtility.shared.stopActivityIndicator()
|
|
|
- }
|
|
|
-
|
|
|
if error?.isExplicitlyCancelledError ?? false {
|
|
|
|
|
|
NCManageDatabase.shared.setMetadataSession(ocId: metadata.ocId, session: "", sessionError: "", sessionSelector: selector, sessionTaskIdentifier: 0, status: NCGlobal.shared.metadataStatusNormal)
|