Browse Source

improved

Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
Marino Faggiana 1 year ago
parent
commit
ddca06e1a5

+ 2 - 0
iOSClient/NCGlobal.swift

@@ -448,6 +448,8 @@ class NCGlobal: NSObject {
     var capabilityFileSharingRemoteExpireDateEnforced: Bool     = false
     var capabilityFileSharingRemoteExpireDateDays: Int          = 0
     var capabilityFileSharingDefaultPermission: Int             = 0
+    var capabilityFileLivePhoto: Bool                           = false
+
 
     var capabilityThemingColor: String                          = ""
     var capabilityThemingColorElement: String                   = ""

+ 3 - 3
iOSClient/Networking/NCNetworking.swift

@@ -582,9 +582,10 @@ class NCNetworking: NSObject, NKCommonDelegate {
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NCManageDatabase.shared.deleteChunks(account: account, ocId: metadata.ocId, directory: directory)
                 NCContentPresenter().messageNotification("_chunk_files_null_", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: .error)
-            case NKError.chunkFileNull: // (fileSize == 0)
+            case NKError.chunkFileNull:
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                 NCManageDatabase.shared.deleteChunks(account: account, ocId: metadata.ocId, directory: directory)
+                NCContentPresenter().messageNotification("_chunk_file_null_", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: .error)
             case NKError.chunkFileUpload:
                 if let afError, (afError.isExplicitlyCancelledError || sessionTaskFailedCode == NCGlobal.shared.errorExplicitlyCancelled ) {
                     NCManageDatabase.shared.deleteChunks(account: account, ocId: metadata.ocId, directory: directory)
@@ -690,8 +691,7 @@ class NCNetworking: NSObject, NKCommonDelegate {
                 utilityFileSystem.removeFile(atPath: utilityFileSystem.getDirectoryProviderStorageOcId(ocIdTemp))
             }
 
-            // TODO: SET SERVER LIVEPHOTO
-            // NCLivePhoto().setLivephoto(metadata: metadata)
+            NCLivePhoto().setLivephoto(metadata: metadata)
 
             NextcloudKit.shared.nkCommonInstance.writeLog("[SUCCESS] Upload complete " + serverUrl + "/" + fileName + ", result: success(\(size) bytes)")
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId": metadata.ocId, "serverUrl": metadata.serverUrl, "account": metadata.account, "fileName": metadata.fileName, "ocIdTemp": ocIdTemp, "error": error])

+ 1 - 1
iOSClient/Settings/NCSettings.m

@@ -102,7 +102,7 @@
     [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
     [section addFormRow:row];
     // Reset app wrong attemps
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"resetAppAttemps" rowType:XLFormRowDescriptorTypeStepCounter title:NSLocalizedString(@"_reset_app_passcode_", nil)];
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"resetAppAttemps" rowType:XLFormRowDescriptorTypeStepCounter title:NSLocalizedString(@"_reset_wrong_passcode_", nil)];
     [row.cellConfigAtConfigure setObject:@4 forKey:@"stepControl.stepValue"];
     [row.cellConfigAtConfigure setObject:@0 forKey:@"stepControl.minimumValue"];
     [row.cellConfigAtConfigure setObject:@20 forKey:@"stepControl.maximumValue"];

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

@@ -943,10 +943,11 @@
 "_chunk_enough_memory_"     = "It seems there is not enough space to send the file";
 "_chunk_create_folder_"     = "The file could not be sent, please check the server log";
 "_chunk_files_null_"        = "The file for sending could not be created";
+"_chunk_file_null_"         = "The file could not be sended";
 "_chunk_move_"              = "The sent file could not be reassembled, please check the server log";
 "_download_image_"          = "Download image";
 "_download_video_"          = "Download video";
-"_reset_app_passcode_"      = "Resets the app after wrong passcode";
+"_reset_wrong_passcode_"    = "Resets after wrong passcode";
 "_failes_attemps_reset_"    = "Number of failed attempts. App reset";
 
 // Video

+ 2 - 0
iOSClient/Utility/NCLivePhoto.swift

@@ -472,6 +472,8 @@ extension NCLivePhoto {
 
     func setLivephoto(metadata: tableMetadata) {
 
+        guard NCGlobal.shared.capabilityFileLivePhoto else { return }
+
         livePhotoFile = metadata.livePhotoFile
         livePhotoFile2 = metadata.fileName