marinofaggiana 4 سال پیش
والد
کامیت
4f66dacfea
3فایلهای تغییر یافته به همراه12 افزوده شده و 14 حذف شده
  1. 1 1
      Cartfile.resolved
  2. 3 12
      iOSClient/Main/CCSection.m
  3. 8 1
      iOSClient/Main/NCMainCommon.swift

+ 1 - 1
Cartfile.resolved

@@ -18,7 +18,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
-github "nextcloud/ios-communication-library" "33faae53bd2f4a0686285d0028e910087902c025"
+github "nextcloud/ios-communication-library" "34631338c3a591f6328dc9b3834cd58fc9f01691"
 github "realm/realm-cocoa" "v5.3.3"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.5"

+ 3 - 12
iOSClient/Main/CCSection.m

@@ -90,18 +90,9 @@
     */
     
     if ([CCUtility getLivePhoto] && filterLivePhoto) {
-        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]];
-        }];
-        NSString *prevFileNameImage;
-        for (tableMetadata *metadata in arraySoprtedMetadatas) {
-            if ([metadata.typeFile isEqualToString:k_metadataTypeFile_image]) {
-                prevFileNameImage = metadata.fileNameView.stringByDeletingPathExtension;
-            }
-            if ([metadata.typeFile isEqualToString:k_metadataTypeFile_video]) {
-                if ([metadata.fileNameView.stringByDeletingPathExtension isEqualToString:prevFileNameImage]) {
-                    [filterocId addObject:metadata.ocId];
-                }
+        for (tableMetadata *metadata in arrayMetadatas) {
+            if ([metadata.ext isEqualToString:@"mov"] && metadata.livePhoto) {
+                [filterocId addObject:metadata.ocId];
             }
         }
     }

+ 8 - 1
iOSClient/Main/NCMainCommon.swift

@@ -48,7 +48,8 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
         static var cellFavouriteImage = UIImage()
         static var cellMoreImage = UIImage()
         static var cellCommentImage = UIImage()
-        
+        static var cellLivePhotoImage = UIImage()
+
         static var cellFolderEncryptedImage = UIImage()
         static var cellFolderSharedWithMeImage = UIImage()
         static var cellFolderPublicImage = UIImage()
@@ -67,6 +68,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
         NCMainCommonImages.cellFavouriteImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), width: 100, height: 100, color: NCBrandColor.sharedInstance.yellowFavorite)
         NCMainCommonImages.cellMoreImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
         NCMainCommonImages.cellCommentImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "comment"), width: 30, height: 30, color: NCBrandColor.sharedInstance.graySoft)
+        NCMainCommonImages.cellLivePhotoImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "livePhoto"), width: 100, height: 100, color: NCBrandColor.sharedInstance.textView)
         
         NCMainCommonImages.cellFolderEncryptedImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folderEncrypted"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
         NCMainCommonImages.cellFolderSharedWithMeImage = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder_shared_with_me"), width: 600, height: 600, color: NCBrandColor.sharedInstance.brandElement)
@@ -553,6 +555,11 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 if tableE2eEncryption != nil &&  NCUtility.sharedInstance.isEncryptedMetadata(metadata) {
                     cell.status.image = UIImage.init(named: "encrypted")
                 }
+                
+                // Live Photo
+                if metadata.livePhoto && CCUtility.getLivePhoto() {
+                    cell.status.image = NCMainCommonImages.cellLivePhotoImage
+                }
             }
             
             //