diff options
Diffstat (limited to 'iOSClient/Viewer/NCViewerProviderContextMenu.swift')
-rw-r--r-- | iOSClient/Viewer/NCViewerProviderContextMenu.swift | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/iOSClient/Viewer/NCViewerProviderContextMenu.swift b/iOSClient/Viewer/NCViewerProviderContextMenu.swift index 58727b470..7dbc86030 100644 --- a/iOSClient/Viewer/NCViewerProviderContextMenu.swift +++ b/iOSClient/Viewer/NCViewerProviderContextMenu.swift @@ -23,7 +23,7 @@ import UIKit import AVFoundation -import NCCommunication +import NextcloudKit import SVGKit class NCViewerProviderContextMenu: UIViewController { @@ -64,7 +64,7 @@ class NCViewerProviderContextMenu: UIViewController { } else { // ICON - if let image = UIImage(named: metadata.iconName)?.resizeImage(size: CGSize(width: sizeIcon*2, height: sizeIcon*2), isAspectRation: true) { + if let image = UIImage(named: metadata.iconName)?.resizeImage(size: CGSize(width: sizeIcon*2, height: sizeIcon*2)) { imageView.image = image imageView.frame = resize(CGSize(width: sizeIcon, height: sizeIcon)) @@ -80,7 +80,7 @@ class NCViewerProviderContextMenu: UIViewController { } // VIEW IMAGE - if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && CCUtility.fileProviderStorageExists(metadata) { + if metadata.classFile == NKCommon.typeClassFile.image.rawValue && CCUtility.fileProviderStorageExists(metadata) { viewImage(metadata: metadata) } @@ -90,22 +90,22 @@ class NCViewerProviderContextMenu: UIViewController { } // VIEW VIDEO - if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && CCUtility.fileProviderStorageExists(metadata) { + if metadata.classFile == NKCommon.typeClassFile.video.rawValue && CCUtility.fileProviderStorageExists(metadata) { viewVideo(metadata: metadata) } // PLAY SOUND - if metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue && CCUtility.fileProviderStorageExists(metadata) { + if metadata.classFile == NKCommon.typeClassFile.audio.rawValue && CCUtility.fileProviderStorageExists(metadata) { playSound(metadata: metadata) } // AUTO DOWNLOAD VIDEO / AUDIO - // if !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && (metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue || metadata.contentType == "application/pdf") { - if !CCUtility.fileProviderStorageExists(metadata) && (metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) { + // if !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && (metadata.classFile == NKCommon.typeClassFile.video.rawValue || metadata.classFile == NKCommon.typeClassFile.audio.rawValue || metadata.contentType == "application/pdf") { + if !CCUtility.fileProviderStorageExists(metadata) && (metadata.classFile == NKCommon.typeClassFile.video.rawValue || metadata.classFile == NKCommon.typeClassFile.audio.rawValue) { var maxDownload: UInt64 = 0 - if NCNetworking.shared.networkReachability == NCCommunicationCommon.typeReachability.reachableCellular { + if NCNetworking.shared.networkReachability == NKCommon.typeReachability.reachableCellular { maxDownload = NCGlobal.shared.maxAutoDownloadCellular } else { maxDownload = NCGlobal.shared.maxAutoDownload @@ -186,20 +186,20 @@ class NCViewerProviderContextMenu: UIViewController { guard let userInfo = notification.userInfo as NSDictionary?, let ocId = userInfo["ocId"] as? String, - let errorCode = userInfo["errorCode"] as? Int, + let error = userInfo["error"] as? NKError, let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else { return } - if errorCode == 0 && metadata.ocId == self.metadata?.ocId { - if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue { + if error == .success && metadata.ocId == self.metadata?.ocId { + if metadata.classFile == NKCommon.typeClassFile.image.rawValue { viewImage(metadata: metadata) - } else if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue { + } else if metadata.classFile == NKCommon.typeClassFile.video.rawValue { viewVideo(metadata: metadata) - } else if metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue { + } else if metadata.classFile == NKCommon.typeClassFile.audio.rawValue { playSound(metadata: metadata) } } - if errorCode == 0 && metadata.ocId == self.metadataLivePhoto?.ocId { + if error == .success && metadata.ocId == self.metadataLivePhoto?.ocId { viewVideo(metadata: metadata) } if ocId == self.metadata?.ocId || ocId == self.metadataLivePhoto?.ocId { |