marinofaggiana 5 роки тому
батько
коміт
f286c9c005

+ 1 - 1
iOSClient/AutoUpload/NCAutoUpload.m

@@ -419,7 +419,7 @@
             metadataForUpload.status = k_metadataStatusWaitUpload;
 
             // Add Medtadata MOV LIVE PHOTO for upload
-            if ((asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive || asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive+PHAssetMediaSubtypePhotoHDR) && CCUtility.getMOVLivePhoto) {
+            if ((asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive || asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive+PHAssetMediaSubtypePhotoHDR) && CCUtility.getLivePhoto) {
                 
                 NSString *fileNameMove = [NSString stringWithFormat:@"%@.mov", fileName.stringByDeletingPathExtension];
                 NSString *ocId = [CCUtility createMetadataIDFromAccount:appDelegate.activeAccount serverUrl:serverUrl fileNameView:fileNameMove directory:false];

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1200,7 +1200,7 @@
         }
                     
         // Add Medtadata MOV LIVE PHOTO for upload
-        if ((asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive || asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive+PHAssetMediaSubtypePhotoHDR) && CCUtility.getMOVLivePhoto && urls.count == assets.count) {
+        if ((asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive || asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive+PHAssetMediaSubtypePhotoHDR) && CCUtility.getLivePhoto && urls.count == assets.count) {
                 
             NSUInteger index = [assets indexOfObject:asset];
             NSURL *url = [urls objectAtIndex:index];

+ 1 - 1
iOSClient/Main/CCSection.m

@@ -89,7 +89,7 @@
      Live Photo
     */
     
-    if ([CCUtility getMOVLivePhoto]) {
+    if ([CCUtility getLivePhoto]) {
         arraySoprtedMetadatas = [arrayMetadatas sortedArrayUsingComparator:^NSComparisonResult(tableMetadata *obj1, tableMetadata *obj2) {
             return [obj1.fileName compare:obj2.fileName options:NSCaseInsensitiveSearch range:NSMakeRange(0,[obj1.fileName length]) locale:[NSLocale currentLocale]];
         }];

+ 2 - 2
iOSClient/Settings/CCAdvanced.m

@@ -70,7 +70,7 @@
     
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"livePhoto" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_upload_mov_livephoto_", nil)];
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;
-    if ([CCUtility getMOVLivePhoto]) row.value = @"1";
+    if ([CCUtility getLivePhoto]) row.value = @"1";
     else row.value = @"0";
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
@@ -198,7 +198,7 @@
     
     if ([rowDescriptor.tag isEqualToString:@"livePhoto"]) {
         
-        [CCUtility setMOVLivePhoto:[[rowDescriptor.value valueData] boolValue]];
+        [CCUtility setLivePhoto:[[rowDescriptor.value valueData] boolValue]];
     }
     
     if ([rowDescriptor.tag isEqualToString:@"disableLocalCacheAfterUpload"]) {

+ 2 - 2
iOSClient/Utility/CCUtility.h

@@ -174,8 +174,8 @@
 + (BOOL)getDarkModeDetect;
 + (void)setDarkModeDetect:(BOOL)disable;
 
-+ (BOOL)getMOVLivePhoto;
-+ (void)setMOVLivePhoto:(BOOL)set;
++ (BOOL)getLivePhoto;
++ (void)setLivePhoto:(BOOL)set;
 
 // ===== Varius =====
 

+ 12 - 4
iOSClient/Utility/CCUtility.m

@@ -687,15 +687,23 @@
     [UICKeyChainStore setString:sDisable forKey:@"darkModeDetect" service:k_serviceShareKeyChain];
 }
 
-+ (BOOL)getMOVLivePhoto
++ (BOOL)getLivePhoto
 {
-    return [[UICKeyChainStore stringForKey:@"movLivePhoto" service:k_serviceShareKeyChain] boolValue];
+    NSString *valueString = [UICKeyChainStore stringForKey:@"livePhoto" service:k_serviceShareKeyChain];
+    
+    // Default TRUE
+    if (valueString == nil) {
+        [self setLivePhoto:YES];
+        return true;
+    }
+    
+    return [valueString boolValue];
 }
 
-+ (void)setMOVLivePhoto:(BOOL)set
++ (void)setLivePhoto:(BOOL)set
 {
     NSString *sSet = (set) ? @"true" : @"false";
-    [UICKeyChainStore setString:sSet forKey:@"movLivePhoto" service:k_serviceShareKeyChain];
+    [UICKeyChainStore setString:sSet forKey:@"livePhoto" service:k_serviceShareKeyChain];
 }
 
 

+ 1 - 0
iOSClient/Utility/NCUtility.swift

@@ -504,6 +504,7 @@ class NCUtility: NSObject {
     @objc func isLivePhoto(metadata: tableMetadata) -> tableMetadata? {
         
         if metadata.typeFile != k_metadataTypeFile_image && metadata.typeFile != k_metadataTypeFile_video  { return nil }
+        if !CCUtility.getLivePhoto() {return nil }
         let ext = (metadata.fileNameView as NSString).pathExtension.lowercased()
         
         if ext == "mov" {