marinofaggiana 4 жил өмнө
parent
commit
89a46c3062

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -1432,8 +1432,8 @@
 			children = (
 				F702F2CC25EE5B4F008F8E80 /* AppDelegate.swift */,
 				F702F2CE25EE5B5C008F8E80 /* NCGlobal.swift */,
-				F7C1CDD91E6DFC6F005D92BE /* Brand */,
 				F70211F31BAC56E9003FC03E /* Main */,
+				F7C1CDD91E6DFC6F005D92BE /* Brand */,
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
 				F7CA213725F1372B00826ABB /* Account Request */,
 				F7A321621E9E37960069AD1B /* Activity */,

+ 0 - 1
iOSClient/NCGlobal.swift

@@ -145,7 +145,6 @@ class NCGlobal: NSObject {
     @objc let errorCharactersForbidden: Int         = -99993
     @objc let errorCreationFile: Int                = -99992
     @objc let errorReadFile: Int                    = -99991
-    @objc let errorMetadataNotFind: Int             = -99990
     
     // Constants to identify the different permissions of a file
     @objc let permissionShared                      = "S"

+ 4 - 9
iOSClient/Networking/NCNetworkingE2EE.swift

@@ -291,6 +291,8 @@ import Alamofire
                     
                     if let metadata = NCManageDatabase.shared.getMetadataFromOcId(metadata.ocId) {
                         
+                        let metadata = tableMetadata.init(value: metadata)
+                        
                         if error?.isExplicitlyCancelledError ?? false {
                         
                             CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
@@ -298,14 +300,7 @@ import Alamofire
                             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId":metadata.ocId, "ocIdTemp":ocIdTemp, "errorCode":errorCode, "errorDescription":""])
                             completion(0, "")
 
-                        } else if errorCode == 0 && ocId != nil {
-                            
-                            guard let metadataTemp = NCManageDatabase.shared.getMetadataFromOcId(metadata.ocId) else {
-                                completion(NCGlobal.shared.errorMetadataNotFind, "Internal error: metadata not find")
-                                return
-                            }
-                            
-                            let metadata = tableMetadata.init(value: metadataTemp)
+                        } else if errorCode == 0 && ocId != nil {                            
                             
                             NCUtilityFileSystem.shared.moveFileInBackground(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId), toPath: CCUtility.getDirectoryProviderStorageOcId(ocId))
                             
@@ -325,7 +320,7 @@ import Alamofire
                             NCUtility.shared.createImageFrom(fileName: metadata.fileNameView, ocId: metadata.ocId, etag: metadata.etag, typeFile: metadata.typeFile)
                                                     
                             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId":metadata.ocId, "ocIdTemp":ocIdTemp ,"errorCode":errorCode, "errorDescription":""])
-                                                                                        
+                            
                         } else {
                             
                             if errorCode == 401 || errorCode == 403 {