Browse Source

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
7b331d85ad

+ 5 - 1
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

+ 5 - 0
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