marinofaggiana 4 years ago
parent
commit
20d43d18a3

+ 1 - 0
iOSClient/NCGlobal.swift

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

+ 5 - 0
iOSClient/Networking/NCNetworking.swift

@@ -461,10 +461,15 @@ import Queuer
         var filesNames = NCManageDatabase.shared.getChunks(account: metadata.account, ocId: metadata.ocId)
         
         if filesNames.count == 0 {
+            
             if let tmp = NCCommunicationCommon.shared.fileChunks(path: directoryProviderStorageOcId, fileName: metadata.fileName, pathChunks: directoryProviderStorageOcId, sizeInMB: chunkSize) {
                 filesNames = tmp
                 NCManageDatabase.shared.addChunks(account: metadata.account, ocId: metadata.ocId, folderChunk: folderChunk, fileNames: filesNames)
+                
             } else {
+                
+                NCContentPresenter.shared.messageNotification("_error_", description: "_err_file_not_found_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode:NCGlobal.shared.errorReadFile, forced: true)
+                
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 return
             }

+ 1 - 2
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -856,8 +856,7 @@
 "_error_decode_xml_"                    = "Invalid response, error decode XML";
 "_internal_generic_error_"              = "internal error";
 "_editor_unknown_"                      = "Failed to open file: Editor is unknown";
-"_err_asset_not_found_locally_"         = "Error: Photo/video not found locally, removed from upload";
-"_err_asset_not_found_"                 = "Error: Photo/video not found, removed from upload";
+"_err_file_not_found_"                  = "Error: file not found, removed";
 "_err_e2ee_app_version_"                = "Error: The version of app End-to-End encryption is not compatible, please update your server";
 "_err_permission_microphone_"           = "Please allow Microphone usage from Settings";
 "_err_permission_photolibrary_"         = "Please allow Photos from Settings";

+ 1 - 1
iOSClient/Utility/CCUtility.m

@@ -1360,7 +1360,7 @@
     PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[metadata.assetLocalIdentifier] options:nil];
     if (!result.count) {
         if (notification) {
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(NCGlobal.shared.errorInternalError), @"errorDescription": @"_err_asset_not_found_"}];
+            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(NCGlobal.shared.errorInternalError), @"errorDescription": @"_err_file_not_found_"}];
         }
         
         completion(nil, nil);