|
@@ -589,7 +589,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 {
|
|
|
+ } else if metadata.livePhoto && CCUtility.getLivePhoto() {
|
|
|
cell.imageStatus.image = cacheImages.cellLivePhotoImage
|
|
|
}
|
|
|
|
|
@@ -658,15 +658,20 @@ extension NCMedia {
|
|
|
}
|
|
|
let startServerUrl = CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) + mediaPath
|
|
|
|
|
|
- predicateDefault = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND (typeFile == %@ OR typeFile == %@) AND NOT (session CONTAINS[c] 'upload') AND NOT (ext == 'mov' AND livePhoto == true)", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_image, k_metadataTypeFile_video)
|
|
|
+ predicateDefault = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND (typeFile == %@ OR typeFile == %@) AND NOT (session CONTAINS[c] 'upload')", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_image, k_metadataTypeFile_video)
|
|
|
|
|
|
if filterTypeFileImage {
|
|
|
- predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND typeFile == %@ AND NOT (session CONTAINS[c] 'upload') AND NOT (ext == 'mov' AND livePhoto == true)", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_video)
|
|
|
+ predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND typeFile == %@ AND NOT (session CONTAINS[c] 'upload')", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_video)
|
|
|
} else if filterTypeFileVideo {
|
|
|
- predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND typeFile == %@ AND NOT (session CONTAINS[c] 'upload') AND NOT (ext == 'mov' AND livePhoto == true)", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_image)
|
|
|
+ predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND typeFile == %@ AND NOT (session CONTAINS[c] 'upload')", appDelegate.activeAccount, startServerUrl, k_metadataTypeFile_image)
|
|
|
} else {
|
|
|
predicate = predicateDefault
|
|
|
}
|
|
|
+
|
|
|
+ if CCUtility.getLivePhoto() {
|
|
|
+ let predicateLivePhoto = NSPredicate(format: "!(ext == 'mov' AND livePhoto == true)")
|
|
|
+ predicate = NSCompoundPredicate.init(andPredicateWithSubpredicates:[predicate!, predicateLivePhoto])
|
|
|
+ }
|
|
|
|
|
|
NCManageDatabase.sharedInstance.getMetadatasMedia(predicate: predicate!, sort: CCUtility.getMediaSortDate()) { (metadatas) in
|
|
|
DispatchQueue.main.sync {
|