diff options
author | marinofaggiana <ios@nextcloud.com> | 2022-07-18 16:14:32 +0300 |
---|---|---|
committer | marinofaggiana <ios@nextcloud.com> | 2022-07-18 16:14:32 +0300 |
commit | 19372b49b60906b82533bf49ccc690cb069eb340 (patch) | |
tree | 6cc7a4123a4337e2fcdc9c5343606a3816e084d4 | |
parent | e26aa84eea935a97a635c59a7311bf84e756c7fa (diff) |
coding441Fix
Signed-off-by: marinofaggiana <ios@nextcloud.com>
-rw-r--r-- | iOSClient/Networking/NCNetworkingChunkedUpload.swift | 6 | ||||
-rw-r--r-- | iOSClient/Networking/NCNetworkingE2EE.swift | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/iOSClient/Networking/NCNetworkingChunkedUpload.swift b/iOSClient/Networking/NCNetworkingChunkedUpload.swift index 177835dab..939b52fde 100644 --- a/iOSClient/Networking/NCNetworkingChunkedUpload.swift +++ b/iOSClient/Networking/NCNetworkingChunkedUpload.swift @@ -92,7 +92,6 @@ extension NCNetworking { }, progressHandler: { progress in if let size = size { - let totalBytesExpected = size + progress.completedUnitCount let totalBytes = metadata.size let fractionCompleted = Float(totalBytesExpected) / Float(totalBytes) @@ -109,6 +108,11 @@ extension NCNetworking { "progress": NSNumber(value: fractionCompleted), "totalBytes": NSNumber(value: totalBytes), "totalBytesExpected": NSNumber(value: totalBytesExpected)]) + + #if !EXTENSION + let progressType = NCGlobal.progressType(progress: Float(fractionCompleted), totalBytes: totalBytes, totalBytesExpected: totalBytesExpected) + DispatchQueue.main.async { (UIApplication.shared.delegate as! AppDelegate).listProgress[metadata.ocId] = progressType } + #endif } }) { _, _, _, _, _, _, _, errorCode, errorDescription in diff --git a/iOSClient/Networking/NCNetworkingE2EE.swift b/iOSClient/Networking/NCNetworkingE2EE.swift index 81a2d4ad8..d857870ea 100644 --- a/iOSClient/Networking/NCNetworkingE2EE.swift +++ b/iOSClient/Networking/NCNetworkingE2EE.swift @@ -290,6 +290,11 @@ import Alamofire "totalBytes": NSNumber(value: progress.totalUnitCount), "totalBytesExpected": NSNumber(value: progress.completedUnitCount)]) + #if !EXTENSION + let progressType = NCGlobal.progressType(progress: Float(progress.fractionCompleted), totalBytes: progress.totalUnitCount, totalBytesExpected: progress.completedUnitCount) + DispatchQueue.main.async { (UIApplication.shared.delegate as! AppDelegate).listProgress[metadata.ocId] = progressType } + #endif + }) { account, ocId, etag, date, _, _, error, errorCode, errorDescription in NCNetworking.shared.uploadRequest[fileNameLocalPath] = nil |