浏览代码

Improvements

marinofaggiana 4 年之前
父节点
当前提交
3e44c9792e
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      iOSClient/Media/NCMedia.swift

+ 5 - 2
iOSClient/Media/NCMedia.swift

@@ -55,6 +55,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     private var lastContentOffsetY: CGFloat = 0
     private var mediaPath = ""
     private var limit: Int = 100
+    private var livePhoto: Bool = false
     
     struct cacheImages {
         static var cellLivePhotoImage = UIImage()
@@ -589,7 +590,7 @@ extension NCMedia: UICollectionViewDataSource {
         // image status
         if metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio {
             cell.imageStatus.image = cacheImages.cellPlayImage
-        } else if metadata.livePhoto && CCUtility.getLivePhoto() {
+        } else if metadata.livePhoto && livePhoto {
             cell.imageStatus.image = cacheImages.cellLivePhotoImage
         }
         
@@ -653,6 +654,8 @@ extension NCMedia {
             collectionView?.reloadData()
         }
         
+        livePhoto = CCUtility.getLivePhoto()
+        
         if let tableAccount = NCManageDatabase.sharedInstance.getAccountActive() {
             self.mediaPath = tableAccount.mediaPath
         }
@@ -668,7 +671,7 @@ extension NCMedia {
             predicate = predicateDefault
         }
         
-        if CCUtility.getLivePhoto() {
+        if livePhoto {
             let predicateLivePhoto = NSPredicate(format: "!(ext == 'mov' AND livePhoto == true)")
             predicate = NSCompoundPredicate.init(andPredicateWithSubpredicates:[predicate!, predicateLivePhoto])
         }