marinofaggiana 4 年之前
父節點
當前提交
1c9557337b
共有 2 個文件被更改,包括 25 次插入6 次删除
  1. 4 1
      iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift
  2. 21 5
      iOSClient/Main/Menu/NCViewer+Menu.swift

+ 4 - 1
iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift

@@ -156,14 +156,17 @@ extension NCCollectionViewCommon {
         //
         if metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileVideo {
             var title: String = NSLocalizedString("_save_selected_files_", comment: "")
+            var icon = UIImage(named: "saveSelectedFiles")!.image(color: NCBrandColor.shared.icon, size: 50)
             let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata)
             if metadataMOV != nil {
                 title = NSLocalizedString("_livephoto_save_", comment: "")
+                icon = UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.icon, size: 50)
             }
+            
             actions.append(
                 NCMenuAction(
                     title: title,
-                    icon: UIImage(named: "saveSelectedFiles")!.image(color: NCBrandColor.shared.icon, size: 50),
+                    icon: icon,
                     action: { menuAction in
                         if metadataMOV != nil {
                             NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV!)

+ 21 - 5
iOSClient/Main/Menu/NCViewer+Menu.swift

@@ -256,7 +256,7 @@ extension NCViewer {
         }
         
         //
-        // IMAGE - VIDEO - AUDIO
+        // DOWNLOAD IMAGE MAX RESOLUTION
         //
         if metadata.session == "" {
             if metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileImage && !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && metadata.session == "" {
@@ -272,13 +272,29 @@ extension NCViewer {
             }
         }
         
-        if let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
+        //
+        // SAVE IMAGE / VIDEO
+        //
+        if metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCBrandGlobal.shared.metadataTypeFileVideo {
+            
+            var title: String = NSLocalizedString("_save_selected_files_", comment: "")
+            var icon = UIImage(named: "saveSelectedFiles")!.image(color: NCBrandColor.shared.icon, size: 50)
+            let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata)
+            if metadataMOV != nil {
+                title = NSLocalizedString("_livephoto_save_", comment: "")
+                icon = UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.icon, size: 50)
+            }
+            
             actions.append(
                 NCMenuAction(
-                    title: NSLocalizedString("_livephoto_save_", comment: ""),
-                    icon: UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.icon, size: 50),
+                    title: title,
+                    icon: icon,
                     action: { menuAction in
-                        NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV)
+                        if metadataMOV != nil {
+                            NCCollectionCommon.shared.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV!)
+                        } else {
+                            NCOperationQueue.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorSaveAlbum, setFavorite: false)
+                        }
                     }
                 )
             )