diff options
author | marinofaggiana <marino@marinofaggiana.com> | 2021-01-16 17:47:29 +0300 |
---|---|---|
committer | marinofaggiana <marino@marinofaggiana.com> | 2021-01-16 17:47:29 +0300 |
commit | 1c9557337b321d90f47c6d335a92c43351118c52 (patch) | |
tree | c06d4eedbda4a8b78c89abac55cc1e9a48937a78 /iOSClient | |
parent | 8ee13b36aa0d3bbed0a1748b18ce336cedae46df (diff) |
fix
Diffstat (limited to 'iOSClient')
-rw-r--r-- | iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift | 5 | ||||
-rw-r--r-- | iOSClient/Main/Menu/NCViewer+Menu.swift | 26 |
2 files changed, 25 insertions, 6 deletions
diff --git a/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift b/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift index 691b7cb08..3f887053f 100644 --- a/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift +++ b/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!) diff --git a/iOSClient/Main/Menu/NCViewer+Menu.swift b/iOSClient/Main/Menu/NCViewer+Menu.swift index b59904cbc..59a208d85 100644 --- a/iOSClient/Main/Menu/NCViewer+Menu.swift +++ b/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) + } } ) ) |