marinofaggiana 3 years ago
parent
commit
2a701fc538

+ 1 - 1
File Provider Extension/FileProviderExtension.swift

@@ -119,7 +119,7 @@ class FileProviderExtension: NSFileProviderExtension, NCNetworkingDelegate {
             metadata.fileName = "root"
             metadata.fileNameView = "root"
             metadata.serverUrl = fileProviderData.shared.homeServerUrl
-            metadata.classFile = NCGlobal.shared.metadataClassDirectory
+            metadata.classFile = NCCommunicationCommon.typeClassFile.directory.rawValue
             
             return FileProviderItem(metadata: metadata, parentItemIdentifier: NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue))
             

+ 3 - 3
iOSClient/Data/NCManageDatabase.swift

@@ -1879,10 +1879,10 @@ class NCManageDatabase: NSObject {
         }
         
         // Live Photo "DETECT"
-        if !metadata.directory && !metadata.livePhoto && (metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue) {
+        if !metadata.directory && !metadata.livePhoto && (metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue) {
             var classFile = metadata.classFile
             if classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
-                classFile = NCGlobal.shared.metadataClassVideo
+                classFile = NCCommunicationCommon.typeClassFile.video.rawValue
             } else {
                 classFile = NCCommunicationCommon.typeClassFile.image.rawValue
             }
@@ -2494,7 +2494,7 @@ class NCManageDatabase: NSObject {
         }
         
         if classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
-            classFile = NCGlobal.shared.metadataClassVideo
+            classFile = NCCommunicationCommon.typeClassFile.video.rawValue
         } else {
             classFile = NCCommunicationCommon.typeClassFile.image.rawValue
         }

+ 2 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1255,10 +1255,10 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
             guard let metadataTouch = metadataTouch else { return }
             let imageIcon = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
             
-            if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+            if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
                 var metadatas: [tableMetadata] = []
                 for metadata in dataSource.metadatas {
-                    if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+                    if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
                         metadatas.append(metadata)
                     }
                 }

+ 2 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -23,6 +23,7 @@
 
 import UIKit
 import Queuer
+import NCCommunication
 
 protocol createFormUploadAssetsDelegate {
     func dismissFormUploadAssets()
@@ -440,7 +441,7 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
                             metadataMOVForUpload.sessionSelector = NCGlobal.shared.selectorUploadFile
                             metadataMOVForUpload.size = fileSize
                             metadataMOVForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
-                            metadataMOVForUpload.classFile = NCGlobal.shared.metadataClassVideo
+                            metadataMOVForUpload.classFile = NCCommunicationCommon.typeClassFile.video.rawValue
 
                             metadatasMOV.append(metadataMOVForUpload)
                         }

+ 3 - 3
iOSClient/Main/NCFunctionCenter.swift

@@ -75,7 +75,7 @@ import Queuer
                                 
                                 self.openDocumentController(metadata: metadata)
                                 
-                            } else if metadata.classFile == NCGlobal.shared.metadataClassFileCompress || metadata.classFile == NCGlobal.shared.metadataClassUnknown {
+                            } else if metadata.classFile == NCCommunicationCommon.typeClassFile.compress.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.unknow.rawValue {
 
                                 self.openDocumentController(metadata: metadata)
                                 
@@ -320,7 +320,7 @@ import Queuer
                 NCContentPresenter.shared.messageNotification("_save_selected_files_", description: "_file_not_saved_cameraroll_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: NCGlobal.shared.errorFileNotSaved)
             }
             
-        } else if metadata.classFile == NCGlobal.shared.metadataClassVideo && status == PHAuthorizationStatus.authorized {
+        } else if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && status == PHAuthorizationStatus.authorized {
             
             if UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(fileNamePath) {
                 UISaveVideoAtPathToSavedPhotosAlbum(fileNamePath, self, #selector(SaveAlbum(_:didFinishSavingWithError:contextInfo:)), nil)
@@ -872,7 +872,7 @@ import Queuer
         
         var children: [UIMenuElement] = [favorite, offline, openIn, rename, moveCopy, copy, delete]
 
-        if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo) {
+        if (metadata.contentType != "image/svg+xml") && (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue) {
             children.insert(save, at: 2)
         }
         

+ 3 - 3
iOSClient/Media/NCMedia.swift

@@ -425,7 +425,7 @@ extension NCMedia: UICollectionViewDataSource {
             }
             cell.date = metadata.date as Date
 
-            if metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+            if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
                 cell.imageStatus.image = cacheImages.cellPlayImage
             } else if metadata.livePhoto && livePhoto {
                 cell.imageStatus.image = cacheImages.cellLivePhotoImage
@@ -487,10 +487,10 @@ extension NCMedia {
         }
         let startServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account) + mediaPath
         
-        predicateDefault = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND (classFile == %@ OR classFile == %@) AND NOT (session CONTAINS[c] 'upload')", appDelegate.account, startServerUrl, NCCommunicationCommon.typeClassFile.image.rawValue, NCGlobal.shared.metadataClassVideo)
+        predicateDefault = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND (classFile == %@ OR classFile == %@) AND NOT (session CONTAINS[c] 'upload')", appDelegate.account, startServerUrl, NCCommunicationCommon.typeClassFile.image.rawValue, NCCommunicationCommon.typeClassFile.video.rawValue)
         
         if filterClassTypeImage {
-            predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND classFile == %@ AND NOT (session CONTAINS[c] 'upload')", appDelegate.account, startServerUrl, NCGlobal.shared.metadataClassVideo)
+            predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND classFile == %@ AND NOT (session CONTAINS[c] 'upload')", appDelegate.account, startServerUrl, NCCommunicationCommon.typeClassFile.video.rawValue)
         } else if filterClassTypeVideo {
             predicate = NSPredicate(format: "account == %@ AND serverUrl BEGINSWITH %@ AND classFile == %@ AND NOT (session CONTAINS[c] 'upload')", appDelegate.account, startServerUrl, NCCommunicationCommon.typeClassFile.image.rawValue)
         } else {

+ 3 - 3
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -158,7 +158,7 @@ extension NCCollectionViewCommon {
         //
         // OPEN with external editor
         //
-        if metadata.classFile == NCGlobal.shared.metadataClassDocument && editors.contains(NCGlobal.shared.editorText) && ((editors.contains(NCGlobal.shared.editorOnlyoffice) || isRichDocument))  {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.document.rawValue && editors.contains(NCGlobal.shared.editorText) && ((editors.contains(NCGlobal.shared.editorOnlyoffice) || isRichDocument))  {
             
             var editor = ""
             var title = ""
@@ -220,7 +220,7 @@ extension NCCollectionViewCommon {
         //
         // SAVE
         //
-        if (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && metadata.contentType != "image/svg+xml") || metadata.classFile == NCGlobal.shared.metadataClassVideo {
+        if (metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && metadata.contentType != "image/svg+xml") || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
             var title: String = NSLocalizedString("_save_selected_files_", comment: "")
             var icon = NCUtility.shared.loadImage(named: "square.and.arrow.down")
             let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata)
@@ -501,7 +501,7 @@ extension NCCollectionViewCommon {
                 action: { menuAction in
                     for ocId in self.selectOcId {
                         if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
-                            if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo {
+                            if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
                                 if let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
                                     NCFunctionCenter.shared.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV)
                                 } else {

+ 1 - 1
iOSClient/Menu/NCMedia+Menu.swift

@@ -173,7 +173,7 @@ extension NCMedia {
                         self.isEditMode = false
                         for ocId in self.selectOcId {
                             if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
-                                if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo {
+                                if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
                                     if let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
                                         NCFunctionCenter.shared.saveLivePhoto(metadata: metadata, metadataMOV: metadataMOV)
                                     } else {

+ 1 - 1
iOSClient/Menu/NCViewer+Menu.swift

@@ -139,7 +139,7 @@ extension NCViewer {
         //
         // SAVE IMAGE / VIDEO
         //
-        if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
             
             var title: String = NSLocalizedString("_save_selected_files_", comment: "")
             var icon = NCUtility.shared.loadImage(named: "square.and.arrow.down")

+ 1 - 9
iOSClient/NCGlobal.swift

@@ -221,15 +221,7 @@ class NCGlobal: NSObject {
     @objc let permissionMaxFolderShare: Int         = 31
     @objc let permissionDefaultFileRemoteShareNoSupportShareOption: Int     = 3
     @objc let permissionDefaultFolderRemoteShareNoSupportShareOption: Int   = 15
-    
-    // classType (metadata)
-    //
-    @objc let metadataClassFileCompress             = "compress"
-    @objc let metadataClassDirectory                = "directory"
-    @objc let metadataClassDocument                 = "document"
-    @objc let metadataClassUnknown                  = "unknow"
-    @objc let metadataClassVideo                    = "video"
-    
+        
     // Filename Mask and Type
     //
     let keyFileNameMask                             = "fileNameMask"

+ 2 - 2
iOSClient/Networking/NCAutoUpload.swift

@@ -240,7 +240,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                         metadataForUpload.size = NCUtilityFileSystem.shared.getFileSize(asset: asset)
                         metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
                         if assetMediaType == PHAssetMediaType.video {
-                            metadataForUpload.classFile = NCGlobal.shared.metadataClassVideo
+                            metadataForUpload.classFile = NCCommunicationCommon.typeClassFile.video.rawValue
                         } else if (assetMediaType == PHAssetMediaType.image) {
                             metadataForUpload.classFile = NCCommunicationCommon.typeClassFile.image.rawValue
                         }
@@ -269,7 +269,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                                     metadataForUpload.sessionSelector = selector
                                     metadataForUpload.size = NCUtilityFileSystem.shared.getFileSize(filePath: filePath)
                                     metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
-                                    metadataForUpload.classFile = NCGlobal.shared.metadataClassVideo
+                                    metadataForUpload.classFile = NCCommunicationCommon.typeClassFile.video.rawValue
                                     
                                     if selector == NCGlobal.shared.selectorUploadAutoUpload {
                                         NCCommunicationCommon.shared.writeLog("Automatic upload added Live Photo \(metadataForUpload.fileNameView) (\(metadataForUpload.size) bytes) with Identifier \(metadataForUpload.assetLocalIdentifier)")

+ 1 - 1
iOSClient/Networking/NCNetworkingProcessUpload.swift

@@ -73,7 +73,7 @@ class NCNetworkingProcessUpload: NSObject {
                     let limit = self.maxConcurrentOperationUpload - counterUpload
                     var predicate = NSPredicate()
                     if UIApplication.shared.applicationState == .background {
-                        predicate = NSPredicate(format: "sessionSelector == %@ AND status == %d AND (classFile != %@ || livePhoto == true)", sessionSelector, NCGlobal.shared.metadataStatusWaitUpload, NCGlobal.shared.metadataClassVideo)
+                        predicate = NSPredicate(format: "sessionSelector == %@ AND status == %d AND (classFile != %@ || livePhoto == true)", sessionSelector, NCGlobal.shared.metadataStatusWaitUpload, NCCommunicationCommon.typeClassFile.video.rawValue)
                     } else {
                         predicate = NSPredicate(format: "sessionSelector == %@ AND status == %d", sessionSelector, NCGlobal.shared.metadataStatusWaitUpload)
                     }

+ 2 - 2
iOSClient/Utility/NCUtility.swift

@@ -438,7 +438,7 @@ class NCUtility: NSObject {
         
         if FileManager().fileExists(atPath: fileNamePathPreview) && FileManager().fileExists(atPath: fileNamePathIcon) { return }
         if !CCUtility.fileProviderStorageExists(ocId, fileNameView: fileName) { return }
-        if classFile != NCCommunicationCommon.typeClassFile.image.rawValue && classFile != NCGlobal.shared.metadataClassVideo { return }
+        if classFile != NCCommunicationCommon.typeClassFile.image.rawValue && classFile != NCCommunicationCommon.typeClassFile.video.rawValue { return }
         
         if classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
             
@@ -450,7 +450,7 @@ class NCUtility: NSObject {
             try? scaleImagePreview?.jpegData(compressionQuality: 0.7)?.write(to: URL(fileURLWithPath: fileNamePathPreview))
             try? scaleImageIcon?.jpegData(compressionQuality: 0.7)?.write(to: URL(fileURLWithPath: fileNamePathIcon))
             
-        } else if classFile == NCGlobal.shared.metadataClassVideo {
+        } else if classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
             
             let videoPath = NSTemporaryDirectory()+"tempvideo.mp4"
             NCUtilityFileSystem.shared.linkItem(atPath: fileNamePath, toPath: videoPath)

+ 2 - 2
iOSClient/Viewer/NCViewer.swift

@@ -43,7 +43,7 @@ class NCViewer: NSObject {
         var editor = editor
         
         // IMAGE AUDIO VIDEO
-        if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue || metadata.classFile == NCGlobal.shared.metadataClassVideo {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
             
             if let navigationController = viewController.navigationController {
                             
@@ -64,7 +64,7 @@ class NCViewer: NSObject {
         }
         
         // DOCUMENTS
-        if metadata.classFile == NCGlobal.shared.metadataClassDocument {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.document.rawValue {
                 
             // PDF
             if metadata.contentType == "application/pdf" || metadata.contentType == "com.adobe.pdf" {

+ 3 - 3
iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

@@ -325,7 +325,7 @@ class NCViewerImage: UIViewController {
             return image
         }
         
-        if metadata.classFile == NCGlobal.shared.metadataClassVideo && !metadata.hasPreview {
+        if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && !metadata.hasPreview {
             NCUtility.shared.createImageFrom(fileName: metadata.fileNameView, ocId: metadata.ocId, etag: metadata.etag, classFile: metadata.classFile)
         }
         
@@ -531,7 +531,7 @@ extension NCViewerImage: UIGestureRecognizerDelegate {
             return
         }
         
-        if currentMetadata.classFile == NCGlobal.shared.metadataClassVideo || currentMetadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+        if currentMetadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || currentMetadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
             
             if self.viewerVideo?.pictureInPictureOcId != currentMetadata.ocId {
                                 
@@ -593,7 +593,7 @@ extension NCViewerImage: NCViewerImageZoomDelegate {
         toolBar.isHidden = true
         viewerVideo = NCViewerVideo.init(view: viewerImageZoom.imageView, progressView: progressView, viewerVideoToolBar: toolBar)
         
-        if (currentMetadata.classFile == NCGlobal.shared.metadataClassVideo || currentMetadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) {
+        if (currentMetadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || currentMetadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) {
             DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
                 self.viewerVideo?.videoPlay(metadata: metadata)
             }

+ 1 - 1
iOSClient/Viewer/NCViewerImage/NCViewerImageDetailView.swift

@@ -162,7 +162,7 @@ class NCViewerImageDetailView: UIView {
                 dimLabel.text = NSLocalizedString("_dimension_", comment: "")
                 dimValue.text = "\(Int(image.size.width)) x \(Int(image.size.height))"
             }
-        } else if metadata?.classFile == NCGlobal.shared.metadataClassVideo || metadata?.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue  {
+        } else if metadata?.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata?.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue  {
             NCNetworking.shared.getVideoUrl(metadata: metadata!) { url in
                 if let url = url {
                     let playerVideo = AVPlayer(url: url)

+ 1 - 1
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -80,7 +80,7 @@ class NCViewerImageZoom: UIViewController {
         if image == nil {
             var named = "noPreview"
             if metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue { named = "noPreviewAudio" }
-            if metadata.classFile == NCGlobal.shared.metadataClassVideo { named = "noPreviewVideo" }
+            if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue { named = "noPreviewVideo" }
             image = UIImage.init(named: named)!.image(color: .gray, size: view.frame.width)
             self.noPreview = true
         }

+ 4 - 4
iOSClient/Viewer/NCViewerProviderContextMenu.swift

@@ -92,7 +92,7 @@ class NCViewerProviderContextMenu: UIViewController  {
             }
             
             // VIEW VIDEO
-            if metadata.classFile == NCGlobal.shared.metadataClassVideo && CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+            if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                 viewVideo(metadata: metadata)
             }
             
@@ -102,8 +102,8 @@ class NCViewerProviderContextMenu: UIViewController  {
             }
             
             // AUTO DOWNLOAD VIDEO / AUDIO
-            // if !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && (metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue || metadata.contentType == "application/pdf") {
-            if !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) && (metadata.classFile == NCGlobal.shared.metadataClassVideo || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) {
+            // 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.ocId, fileNameView: metadata.fileNameView) && (metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue) {
                 
                 var maxDownload: UInt64 = 0
                 
@@ -191,7 +191,7 @@ class NCViewerProviderContextMenu: UIViewController  {
                 if errorCode == 0 && metadata.ocId == self.metadata?.ocId {
                     if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue {
                         viewImage(metadata: metadata)
-                    } else if metadata.classFile == NCGlobal.shared.metadataClassVideo {
+                    } else if metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
                         viewVideo(metadata: metadata)
                     } else if metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
                         playSound(metadata: metadata)

+ 2 - 1
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -22,6 +22,7 @@
 //
 
 import Foundation
+import NCCommunication
 
 class NCViewerVideo: NSObject {
     
@@ -57,7 +58,7 @@ class NCViewerVideo: NSObject {
 
     @objc func applicationDidEnterBackground(_ notification: NSNotification) {
         
-        if metadata?.classFile == NCGlobal.shared.metadataClassVideo {
+        if metadata?.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
             player?.pause()
         }
     }