فهرست منبع

Fix Autoupload 0 length

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 سال پیش
والد
کامیت
7e66a215d1

+ 0 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -415,7 +415,6 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
                 metadataForUpload.assetLocalIdentifier = asset.localIdentifier
                 metadataForUpload.session = self.session
                 metadataForUpload.sessionSelector = NCGlobal.shared.selectorUploadFile
-                metadataForUpload.size = NCUtilityFileSystem.shared.getFileSize(asset: asset)
                 metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
 
                 if livePhoto {

+ 0 - 1
iOSClient/Networking/NCAutoUpload.swift

@@ -169,7 +169,6 @@ class NCAutoUpload: NSObject {
                         metadataForUpload.assetLocalIdentifier = asset.localIdentifier
                         metadataForUpload.session = session
                         metadataForUpload.sessionSelector = selector
-                        metadataForUpload.size = NCUtilityFileSystem.shared.getFileSize(asset: asset)
                         metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
                         if assetMediaType == PHAssetMediaType.video {
                             metadataForUpload.classFile = NCCommunicationCommon.typeClassFile.video.rawValue

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -448,7 +448,7 @@ import Queuer
         
         let metadata = tableMetadata.init(value: metadata)
 
-        if CCUtility.fileProviderStorageExists(metadata) {
+        if metadata.assetLocalIdentifier.isEmpty {
 
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
             let results = NCCommunicationCommon.shared.getInternalType(fileName: metadata.fileNameView, mimeType: metadata.contentType, directory: false)

+ 0 - 14
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -32,20 +32,6 @@ class NCUtilityFileSystem: NSObject {
 
     let fileManager = FileManager.default
 
-    @objc func getFileSize(asset: PHAsset) -> Int64 {
-
-        let resources = PHAssetResource.assetResources(for: asset)
-
-        if let resource = resources.first {
-            if resource.responds(to: #selector(NSDictionary.fileSize)) {
-                let unsignedInt64 = resource.value(forKey: "fileSize") as! CLong
-                return Int64(bitPattern: UInt64(unsignedInt64))
-            }
-        }
-
-        return 0
-    }
-
     @objc func getFileSize(filePath: String) -> Int64 {
 
         do {