marinofaggiana 4 years ago
parent
commit
64e53c47be

+ 3 - 8
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -1072,15 +1072,10 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
                 NCOperationQueue.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorSaveAlbum, setFavorite: false)
             }
             
-            if metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileVideo || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileAudio {
-                if let metadataLive = NCManageDatabase.shared.isLivePhoto(metadata: metadata) {
-                    if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && CCUtility.fileProviderStorageExists(metadataLive.ocId, fileNameView: metadataLive.fileNameView) {
+            if let metadataMov = NCManageDatabase.shared.isLivePhoto(metadata: metadata) {
+                save = UIAction(title: NSLocalizedString("_livephoto_save_", comment: ""), image: UIImage(systemName: "square.and.arrow.down")) { action in
                         
-                        save = UIAction(title: NSLocalizedString("_livephoto_save_", comment: ""), image: UIImage(systemName: "square.and.arrow.down")) { action in
-                            
-                            NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMov: metadataLive, progressView: nil, viewActivity: self.view)
-                        }
-                    }
+                    NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMov: metadataMov, progressView: nil, viewActivity: self.view)
                 }
             }
             

+ 3 - 8
iOSClient/Media/NCMedia.swift

@@ -512,15 +512,10 @@ extension NCMedia: UICollectionViewDelegate {
                 NCOperationQueue.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorSaveAlbum, setFavorite: false)
             }
             
-            if metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileVideo || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileAudio {
-                if let metadataLive = NCManageDatabase.shared.isLivePhoto(metadata: metadata) {
-                    if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && CCUtility.fileProviderStorageExists(metadataLive.ocId, fileNameView: metadataLive.fileNameView) {
+            if let metadataMov = NCManageDatabase.shared.isLivePhoto(metadata: metadata) {
+                save = UIAction(title: NSLocalizedString("_livephoto_save_", comment: ""), image: UIImage(systemName: "square.and.arrow.down")) { action in
                         
-                        save = UIAction(title: NSLocalizedString("_livephoto_save_", comment: ""), image: UIImage(systemName: "square.and.arrow.down")) { action in
-                            
-                            NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMov: metadataLive, progressView: nil, viewActivity: self.view)
-                        }
-                    }
+                    NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMov: metadataMov, progressView: nil, viewActivity: self.view)
                 }
             }