Browse Source

align version

marinofaggiana 3 years ago
parent
commit
cc9c8c2751

+ 25 - 25
Nextcloud.xcodeproj/project.pbxproj

@@ -38,7 +38,6 @@
 		F703FFE7268CA52900FA1459 /* KTVHTTPCache.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F70B86792642CF5300ED5349 /* KTVHTTPCache.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		F703FFE8268CA52900FA1459 /* KTVCocoaHTTPServer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = F70B867E2642CF5400ED5349 /* KTVCocoaHTTPServer.xcframework */; };
 		F703FFE9268CA52900FA1459 /* KTVCocoaHTTPServer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F70B867E2642CF5400ED5349 /* KTVCocoaHTTPServer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
-		F703FFEB268CA60D00FA1459 /* NCKTVHTTPCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F703FFEA268CA60D00FA1459 /* NCKTVHTTPCache.swift */; };
 		F70460522499061800BB98A7 /* NotificationCenter+MainThread.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */; };
 		F70460532499095400BB98A7 /* NotificationCenter+MainThread.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */; };
 		F70460542499095400BB98A7 /* NotificationCenter+MainThread.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */; };
@@ -152,7 +151,6 @@
 		F74DE14425135B6800917068 /* NCTransfers.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F74DE14225135B6800917068 /* NCTransfers.storyboard */; };
 		F7501C322212E57500FB1415 /* NCMedia.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7501C302212E57400FB1415 /* NCMedia.storyboard */; };
 		F7501C332212E57500FB1415 /* NCMedia.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7501C312212E57400FB1415 /* NCMedia.swift */; };
-		F752011D25480387000BF3A7 /* NCViewerAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F752011C25480387000BF3A7 /* NCViewerAVPlayerViewController.swift */; };
 		F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F755BD9A20594AC7008C5FBB /* NCService.swift */; };
 		F7581D1A25EFDA61004DC699 /* NCLoginWeb+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7581D1925EFDA60004DC699 /* NCLoginWeb+Menu.swift */; };
 		F7581D2425EFDDDF004DC699 /* NCMedia+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7581D2325EFDDDF004DC699 /* NCMedia+Menu.swift */; };
@@ -270,6 +268,10 @@
 		F79EC77F26316193004E59D6 /* NCRenameFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70D87CE25EE6E58008CBBBD /* NCRenameFile.swift */; };
 		F79EC784263161BA004E59D6 /* NCRenameFile.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F70D87CD25EE6E58008CBBBD /* NCRenameFile.storyboard */; };
 		F79EC78926316AC4004E59D6 /* NCPopupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F30725EE5D47008F8E80 /* NCPopupViewController.swift */; };
+		F79EDAA326B004980007D134 /* NCViewerVideoToolBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79EDA9F26B004980007D134 /* NCViewerVideoToolBar.swift */; };
+		F79EDAA426B004980007D134 /* NCKTVHTTPCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79EDAA026B004980007D134 /* NCKTVHTTPCache.swift */; };
+		F79EDAA526B004980007D134 /* NCViewerVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79EDAA126B004980007D134 /* NCViewerVideo.swift */; };
+		F79EDAA626B004980007D134 /* NCViewerAVPlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79EDAA226B004980007D134 /* NCViewerAVPlayerViewController.swift */; };
 		F7A0D1352591FBC5008F8A13 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extensions.swift */; };
 		F7A0D1362591FBC5008F8A13 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extensions.swift */; };
 		F7A0D1372591FBC5008F8A13 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extensions.swift */; };
@@ -286,8 +288,6 @@
 		F7B8CD91261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B8CD90261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift */; };
 		F7B8CD96261AF401007C1359 /* NCNetworkingChunkedUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B8CD90261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift */; };
 		F7B8CD9B261AF401007C1359 /* NCNetworkingChunkedUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B8CD90261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift */; };
-		F7BAA040268DECC200AEA403 /* NCViewerVideo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAA03F268DECC200AEA403 /* NCViewerVideo.swift */; };
-		F7BAA042268DF78F00AEA403 /* NCViewerVideoToolBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAA041268DF78F00AEA403 /* NCViewerVideoToolBar.swift */; };
 		F7BAADC81ED5A87C00B7EAD4 /* NCDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */; };
 		F7BAADC91ED5A87C00B7EAD4 /* NCDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */; };
 		F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
@@ -426,7 +426,6 @@
 		F702F2FF25EE5D2C008F8E80 /* english.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = english.txt; sourceTree = "<group>"; };
 		F702F30025EE5D2C008F8E80 /* NYMnemonic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYMnemonic.h; sourceTree = "<group>"; };
 		F702F30725EE5D47008F8E80 /* NCPopupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCPopupViewController.swift; sourceTree = "<group>"; };
-		F703FFEA268CA60D00FA1459 /* NCKTVHTTPCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCKTVHTTPCache.swift; sourceTree = "<group>"; };
 		F70460512499061800BB98A7 /* NotificationCenter+MainThread.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationCenter+MainThread.swift"; sourceTree = "<group>"; };
 		F704B5E22430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCCreateFormUploadConflict.storyboard; sourceTree = "<group>"; };
 		F704B5E42430AA8000632F5F /* NCCreateFormUploadConflict.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadConflict.swift; sourceTree = "<group>"; };
@@ -555,7 +554,6 @@
 		F7501C302212E57400FB1415 /* NCMedia.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCMedia.storyboard; sourceTree = "<group>"; };
 		F7501C312212E57400FB1415 /* NCMedia.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMedia.swift; sourceTree = "<group>"; };
 		F75153232226920200323DDC /* FastScroll.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FastScroll.framework; path = Carthage/Build/iOS/FastScroll.framework; sourceTree = "<group>"; };
-		F752011C25480387000BF3A7 /* NCViewerAVPlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerAVPlayerViewController.swift; sourceTree = "<group>"; };
 		F753701822723D620041C76C /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = gl.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F753701922723E0D0041C76C /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F753701A22723EC80041C76C /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -670,6 +668,10 @@
 		F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCSelect.storyboard; sourceTree = "<group>"; };
 		F79A65C52191D95E00FF6DCC /* NCSelect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelect.swift; sourceTree = "<group>"; };
 		F79B869A265E19D40085C0E0 /* NSMutableAttributedString+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSMutableAttributedString+Extensions.swift"; sourceTree = "<group>"; };
+		F79EDA9F26B004980007D134 /* NCViewerVideoToolBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerVideoToolBar.swift; sourceTree = "<group>"; };
+		F79EDAA026B004980007D134 /* NCKTVHTTPCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCKTVHTTPCache.swift; sourceTree = "<group>"; };
+		F79EDAA126B004980007D134 /* NCViewerVideo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerVideo.swift; sourceTree = "<group>"; };
+		F79EDAA226B004980007D134 /* NCViewerAVPlayerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerAVPlayerViewController.swift; sourceTree = "<group>"; };
 		F7A0D1342591FBC5008F8A13 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = "<group>"; };
 		F7A321AB1E9E6AD50069AD1B /* CCAdvanced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAdvanced.h; sourceTree = "<group>"; };
 		F7A321AC1E9E6AD50069AD1B /* CCAdvanced.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAdvanced.m; sourceTree = "<group>"; };
@@ -693,8 +695,6 @@
 		F7B7504A2397D38E004E13EC /* UIImage+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Extensions.swift"; sourceTree = "<group>"; };
 		F7B8B82F25681C3400967775 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
 		F7B8CD90261AF3F7007C1359 /* NCNetworkingChunkedUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCNetworkingChunkedUpload.swift; sourceTree = "<group>"; };
-		F7BAA03F268DECC200AEA403 /* NCViewerVideo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerVideo.swift; sourceTree = "<group>"; };
-		F7BAA041268DF78F00AEA403 /* NCViewerVideoToolBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerVideoToolBar.swift; sourceTree = "<group>"; };
 		F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDatabase.swift; sourceTree = "<group>"; };
 		F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCManageDatabase.swift; sourceTree = "<group>"; };
 		F7BB04851FD58ACB00BBFD2A /* cs-CZ */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "cs-CZ"; path = "cs-CZ.lproj/Localizable.strings"; sourceTree = "<group>"; };
@@ -1180,7 +1180,7 @@
 				F7F9D1BA25397CE000D9BFF5 /* NCViewer.swift */,
 				F7EFA47725ADBA500083159A /* NCViewerProviderContextMenu.swift */,
 				F79018B1240962C7007C9B6D /* NCViewerImage */,
-				F7A5281B254834500039CA15 /* NCViewerVideo */,
+				F79EDA9E26B004980007D134 /* NCViewerVideo */,
 				F723986A253C9C0E00257F49 /* NCViewerQuickLook */,
 				F76D3CEF2428B3DD005DFA87 /* NCViewerPDF */,
 				F73D11FF253C5F5400DF9BEC /* NCViewerNextcloudText */,
@@ -1201,6 +1201,17 @@
 			path = Select;
 			sourceTree = "<group>";
 		};
+		F79EDA9E26B004980007D134 /* NCViewerVideo */ = {
+			isa = PBXGroup;
+			children = (
+				F79EDA9F26B004980007D134 /* NCViewerVideoToolBar.swift */,
+				F79EDAA026B004980007D134 /* NCKTVHTTPCache.swift */,
+				F79EDAA126B004980007D134 /* NCViewerVideo.swift */,
+				F79EDAA226B004980007D134 /* NCViewerAVPlayerViewController.swift */,
+			);
+			path = NCViewerVideo;
+			sourceTree = "<group>";
+		};
 		F7A0D14E259229FA008F8A13 /* Extensions */ = {
 			isa = PBXGroup;
 			children = (
@@ -1235,17 +1246,6 @@
 			path = Activity;
 			sourceTree = "<group>";
 		};
-		F7A5281B254834500039CA15 /* NCViewerVideo */ = {
-			isa = PBXGroup;
-			children = (
-				F703FFEA268CA60D00FA1459 /* NCKTVHTTPCache.swift */,
-				F752011C25480387000BF3A7 /* NCViewerAVPlayerViewController.swift */,
-				F7BAA03F268DECC200AEA403 /* NCViewerVideo.swift */,
-				F7BAA041268DF78F00AEA403 /* NCViewerVideoToolBar.swift */,
-			);
-			path = NCViewerVideo;
-			sourceTree = "<group>";
-		};
 		F7A80BC7252624C100C7CD01 /* FileViewInFolder */ = {
 			isa = PBXGroup;
 			children = (
@@ -2096,7 +2096,6 @@
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
 				F702F30825EE5D47008F8E80 /* NCPopupViewController.swift in Sources */,
 				F70A58BE24D0349500DED00D /* NCCapabilitiesViewController.swift in Sources */,
-				F752011D25480387000BF3A7 /* NCViewerAVPlayerViewController.swift in Sources */,
 				F733598125C1C188002ABA72 /* NCAskAuthorization.swift in Sources */,
 				370D26AF248A3D7A00121797 /* NCImageCellProtocol.swift in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
@@ -2114,13 +2113,13 @@
 				F72CD63A25C19EBF00F46F9A /* NCAutoUpload.swift in Sources */,
 				F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */,
 				F73B422C2476764F00A30FD3 /* NCNotification.swift in Sources */,
-				F703FFEB268CA60D00FA1459 /* NCKTVHTTPCache.swift in Sources */,
 				371B5A2E23D0B04500FAFAE9 /* NCMenu.swift in Sources */,
+				F79EDAA426B004980007D134 /* NCKTVHTTPCache.swift in Sources */,
+				F79EDAA326B004980007D134 /* NCViewerVideoToolBar.swift in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPickerViewController.swift in Sources */,
 				F72A47EC2487B06B005AD489 /* NCOperationQueue.swift in Sources */,
 				F769454622E9F1B0000A798A /* NCShareCommon.swift in Sources */,
 				F738E8421F90FFD100F95C8E /* NCManageEndToEndEncryption.m in Sources */,
-				F7BAA042268DF78F00AEA403 /* NCViewerVideoToolBar.swift in Sources */,
 				F70753F12542A9A200972D44 /* NCViewerImageZoom.swift in Sources */,
 				F7A80BCB252624C100C7CD01 /* NCFileViewInFolder.swift in Sources */,
 				F78A18B823CDE2B300F681F3 /* NCViewerRichWorkspace.swift in Sources */,
@@ -2165,7 +2164,7 @@
 				F710D1F52405770F00A6033D /* NCViewerPDF.swift in Sources */,
 				F7501C332212E57500FB1415 /* NCMedia.swift in Sources */,
 				F70BFC7420E0FA7D00C67599 /* NCUtility.swift in Sources */,
-				F7BAA040268DECC200AEA403 /* NCViewerVideo.swift in Sources */,
+				F79EDAA526B004980007D134 /* NCViewerVideo.swift in Sources */,
 				F7C1EEA525053A9C00866ACC /* NCDataSource.swift in Sources */,
 				F713FF002472764100214AF6 /* UIImage+animatedGIF.m in Sources */,
 				F749C10B23C4A5340027D966 /* NCIntroCollectionViewCell.swift in Sources */,
@@ -2183,6 +2182,7 @@
 				F7EFA47825ADBA500083159A /* NCViewerProviderContextMenu.swift in Sources */,
 				F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */,
 				F79B869B265E19D40085C0E0 /* NSMutableAttributedString+Extensions.swift in Sources */,
+				F79EDAA626B004980007D134 /* NCViewerAVPlayerViewController.swift in Sources */,
 				F7B7504B2397D38F004E13EC /* UIImage+Extensions.swift in Sources */,
 				F7EFC0CD256BF8DD00461AAD /* NCUserStatus.swift in Sources */,
 				F7DFB7F4219C5CA800680748 /* NCCreateFormUploadScanDocument.swift in Sources */,
@@ -2905,7 +2905,7 @@
 			repositoryURL = "https://github.com/realm/realm-cocoa";
 			requirement = {
 				kind = exactVersion;
-				version = 10.10.0;
+				version = 10.11.0;
 			};
 		};
 		F786D58B253454BF00E3DD7B /* XCRemoteSwiftPackageReference "ios-communication-library" */ = {

+ 4 - 4
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -177,8 +177,8 @@
         "repositoryURL": "https://github.com/realm/realm-cocoa",
         "state": {
           "branch": null,
-          "revision": "77658519b13388c098a7624a94491738f8bb2983",
-          "version": "10.10.0"
+          "revision": "cef59658a3e447bf6994e20af6ec408633963d52",
+          "version": "10.11.0"
         }
       },
       {
@@ -186,8 +186,8 @@
         "repositoryURL": "https://github.com/realm/realm-core",
         "state": {
           "branch": null,
-          "revision": "95da0df7815d7cbaff14ed5e8b73fe4c2a992816",
-          "version": "11.0.4"
+          "revision": "71db56caba8f8ef0398eedfffb82a908cb94ccec",
+          "version": "11.1.1"
         }
       },
       {

+ 209 - 177
Share/NCShareExtension.swift

@@ -91,7 +91,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         tableView.separatorColor = NCBrandColor.shared.separator
         tableView.layer.cornerRadius = 10
         tableView.tableFooterView = UIView(frame: CGRect(origin: .zero, size: CGSize(width: 0, height: 1)))
-
+        commandViewHeightConstraint.constant = heightCommandView
+        
         // Create folder
         createFolderView.layer.cornerRadius = 10
         createFolderImage.image = NCUtility.shared.loadImage(named: "folder.badge.plus", color: NCBrandColor.shared.label)
@@ -131,7 +132,7 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
             if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
                 
                 setAccount(account: activeAccount.account)
-                getFilesExtensionContext { (filesName, error) in
+                getFilesExtensionContext { (filesName) in
                     
                     self.filesName = filesName
                     DispatchQueue.main.async {
@@ -288,6 +289,8 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
             if filesName.count <= 3 {
                 self.tableView.isScrollEnabled = false
             }
+            // Label upload button
+            uploadLabel.text = NSLocalizedString("_upload_", comment: "") + " \(filesName.count) " + NSLocalizedString("_files_", comment: "")
             // Empty
             emptyDataSet = NCEmptyDataSet.init(view: collectionView, offset: -50*counter, delegate: self)
             self.tableView.reloadData()
@@ -694,9 +697,9 @@ extension NCShareExtension: UITableViewDataSource {
 
         let fileName = filesName[indexPath.row]
         let resultInternalType = NCCommunicationCommon.shared.getInternalType(fileName: fileName, mimeType: "", directory: false)
-                
+       
         if let image = UIImage(contentsOfFile: (NSTemporaryDirectory() + fileName)) {
-            imageCell?.image = image
+            imageCell?.image = image.resizeImage(size: CGSize(width: 80, height: 80), isAspectRation: true)
         } else {
             if resultInternalType.iconName.count > 0 {
                 imageCell?.image = UIImage.init(named: resultInternalType.iconName)
@@ -771,196 +774,225 @@ extension NCShareExtension {
         }
     }
     
-    func getFilesExtensionContext(completion: @escaping (_ filesName: [String], _ error: Error?)->())  {
+    func getFilesExtensionContext(completion: @escaping (_ filesName: [String])->())  {
         
+        var itemsProvider: [NSItemProvider] = []
         var filesName: [String] = []
         var conuter = 0
-        var outError: Error? = nil
-        
-        CCUtility.emptyTemporaryDirectory()
+        let dateFormatter = DateFormatter()
+                
+        // ----------------------------------------------------------------------------------------
+
+        // Image
+        func getItem(image: UIImage, fileNameOriginal: String?) {
+            
+            var fileName: String = ""
+            
+            if let pngImageData = image.pngData() {
+            
+                if fileNameOriginal != nil {
+                    fileName =  fileNameOriginal!
+                } else {
+                    fileName = "\(dateFormatter.string(from: Date()))\(conuter).png"
+                }
+                
+                let filenamePath = NSTemporaryDirectory() + fileName
                 
-        if let inputItems : [NSExtensionItem] = extensionContext?.inputItems as? [NSExtensionItem] {
+                if (try? pngImageData.write(to: URL(fileURLWithPath: filenamePath), options: [.atomic])) != nil {
+                    filesName.append(fileName)
+                }
+            }
+        }
+        
+        // URL
+        func getItem(url: NSURL, fileNameOriginal: String?) {
             
-            for item : NSExtensionItem in inputItems {
+            guard let path = url.path else { return }
+            
+            var fileName: String = ""
+
+            if fileNameOriginal != nil {
+                fileName =  fileNameOriginal!
+            } else {
+                if let ext = url.pathExtension {
+                    fileName = "\(dateFormatter.string(from: Date()))\(conuter)." + ext
+                }
+            }
+            
+            let filenamePath = NSTemporaryDirectory() + fileName
+          
+            do {
+                try FileManager.default.removeItem(atPath: filenamePath)
+            }
+            catch { }
+            
+            do {
+                try FileManager.default.copyItem(atPath: path, toPath:filenamePath)
                 
-                if let attachments = item.attachments {
+                do {
+                    let attr : NSDictionary? = try FileManager.default.attributesOfItem(atPath: filenamePath) as NSDictionary?
                     
-                    if attachments.isEmpty {
-                        
-                        extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
-                        completion(filesName, outError)
-                        return
+                    if let _attr = attr {
+                        if _attr.fileSize() > 0 {
+                            filesName.append(fileName)
+                        }
                     }
                     
-                    for (index, current) in (attachments.enumerated()) {
+                } catch { }
+            } catch { }
+        }
+        
+        // Data
+        func getItem(data: Data, fileNameOriginal: String?, description: String) {
+        
+            var fileName: String = ""
+
+            if data.count > 0 {
                         
-                        if current.hasItemConformingToTypeIdentifier(kUTTypeItem as String) || current.hasItemConformingToTypeIdentifier("public.url") {
-                            
-                            var typeIdentifier = ""
-                            if current.hasItemConformingToTypeIdentifier(kUTTypeItem as String) { typeIdentifier = kUTTypeItem as String }
-                            if current.hasItemConformingToTypeIdentifier("public.url") { typeIdentifier = "public.url" }
-                            
-                            current.loadItem(forTypeIdentifier: typeIdentifier, options: nil, completionHandler: {(item, error) -> Void in
-                                
-                                var fileNameOriginal: String?
-                                var fileName: String = ""
-                                
-                                let dateFormatter = DateFormatter()
-                                dateFormatter.dateFormat = "yyyy-MM-dd HH-mm-ss-"
-                                conuter += 1
-                                
-                                if let url = item as? NSURL {
-                                    if FileManager.default.fileExists(atPath: url.path ?? "") {
-                                        fileNameOriginal = url.lastPathComponent!
-                                    } else if url.scheme?.lowercased().contains("http") == true {
-                                        fileNameOriginal = "\(dateFormatter.string(from: Date()))\(conuter).html"
-                                    } else {
-                                        fileNameOriginal = "\(dateFormatter.string(from: Date()))\(conuter)"
-                                    }
-                                }
-                                
-                                if error == nil {
-                                                                        
-                                    if let image = item as? UIImage {
-                                        
-                                        print("item as UIImage")
-                                        
-                                        if let pngImageData = image.pngData() {
-                                        
-                                            if fileNameOriginal != nil {
-                                                fileName =  fileNameOriginal!
-                                            } else {
-                                                fileName = "\(dateFormatter.string(from: Date()))\(conuter).png"
-                                            }
-                                            
-                                            let filenamePath = NSTemporaryDirectory() + fileName
-                                            
-                                            let result = (try? pngImageData.write(to: URL(fileURLWithPath: filenamePath), options: [.atomic])) != nil
-                                        
-                                            if result {
-                                                filesName.append(fileName)
-                                            }
-                                            
-                                        } else {
-                                         
-                                            print("Error image nil")
-                                        }
-                                        
-                                        if index + 1 == attachments.count {
-                                            completion(filesName, outError)
-                                        }
-                                    }
-                                    
-                                    if let url = item as? URL {
-                                        
-                                        let task = URLSession.shared.downloadTask(with: url) { localURL, urlResponse, error in
-                                            
-                                            if let localURL = localURL {
-                                                
-                                                if fileNameOriginal != nil {
-                                                    fileName =  fileNameOriginal!
-                                                } else {
-                                                    let ext = url.pathExtension
-                                                    fileName = "\(dateFormatter.string(from: Date()))\(conuter)." + ext
-                                                }
-                                                
-                                                let filenamePath = NSTemporaryDirectory() + fileName
-                                              
-                                                do {
-                                                    try FileManager.default.removeItem(atPath: filenamePath)
-                                                }
-                                                catch { }
-                                                
-                                                do {
-                                                    try FileManager.default.copyItem(atPath: localURL.path, toPath:filenamePath)
-                                                    
-                                                    do {
-                                                        let attr : NSDictionary? = try FileManager.default.attributesOfItem(atPath: filenamePath) as NSDictionary?
-                                                        
-                                                        if let _attr = attr {
-                                                            if _attr.fileSize() > 0 {
-                                                                
-                                                                filesName.append(fileName)
-                                                            }
-                                                        }
-                                                        
-                                                    } catch let error {
-                                                        outError = error
-                                                    }
-                                                    
-                                                } catch let error {
-                                                    outError = error
-                                                }
-                                            }
-                                            
-                                            if index + 1 == attachments.count {
-                                                completion(filesName, outError)
-                                            }
-                                        }
-                                        task.resume()
-                                    }
-                                    
-                                    if let data = item as? Data {
-                                        
-                                        if data.count > 0 {
-                                        
-                                            print("item as NSdata")
-                                        
-                                            if fileNameOriginal != nil {
-                                                fileName =  fileNameOriginal!
-                                            } else {
-                                                let description = current.description
-                                                let fullNameArr = description.components(separatedBy: "\"")
-                                                let fileExtArr = fullNameArr[1].components(separatedBy: ".")
-                                                let pathExtention = (fileExtArr[fileExtArr.count-1]).uppercased()
-                                                fileName = "\(dateFormatter.string(from: Date()))\(conuter).\(pathExtention)"
-                                            }
-                                            
-                                            let filenamePath = NSTemporaryDirectory() + fileName
-                                            
-                                            FileManager.default.createFile(atPath: filenamePath, contents:data, attributes:nil)
-                                                                                
-                                            filesName.append(fileName)
-                                        }
-                                        
-                                        if index + 1 == attachments.count {
-                                            completion(filesName, outError)
-                                        }
-                                    }
-                                    
-                                    if let data = item as? NSString {
-                                        
-                                        if data.length > 0 {
-                                        
-                                            print("item as NSString")
-                                        
-                                            let fileName = "\(dateFormatter.string(from: Date()))\(conuter).txt"
-                                            let filenamePath = NSTemporaryDirectory() + fileName
-                                        
-                                            FileManager.default.createFile(atPath: filenamePath, contents:data.data(using: String.Encoding.utf8.rawValue), attributes:nil)
-                                        
-                                            filesName.append(fileName)
-                                        }
-                                        
-                                        if index + 1 == attachments.count {
-                                            completion(filesName, outError)
-                                        }
-                                    }
-                                } else {
-                                    completion( filesName, error)
-                                }
-                            })
-                        }
-                    } // end for
+                if fileNameOriginal != nil {
+                    fileName =  fileNameOriginal!
                 } else {
-                    completion(filesName, outError)
+                    let fullNameArr = description.components(separatedBy: "\"")
+                    let fileExtArr = fullNameArr[1].components(separatedBy: ".")
+                    let pathExtention = (fileExtArr[fileExtArr.count-1]).uppercased()
+                    fileName = "\(dateFormatter.string(from: Date()))\(conuter).\(pathExtention)"
+                }
+                
+                let filenamePath = NSTemporaryDirectory() + fileName
+                FileManager.default.createFile(atPath: filenamePath, contents:data, attributes:nil)
+                filesName.append(fileName)
+            }
+        }
+        
+        // String
+        func getItem(string: NSString, fileNameOriginal: String?) {
+                        
+            var fileName: String = ""
+            
+            if string.length > 0 {
+                        
+                fileName = "\(dateFormatter.string(from: Date()))\(conuter).txt"
+                let filenamePath = NSTemporaryDirectory() + "\(dateFormatter.string(from: Date()))\(conuter).txt"
+                FileManager.default.createFile(atPath: filenamePath, contents:string.data(using: String.Encoding.utf8.rawValue), attributes:nil)
+                filesName.append(fileName)
+            }
+        }
+        
+        // ----------------------------------------------------------------------------------------
+                
+        guard let inputItems : [NSExtensionItem] = extensionContext?.inputItems as? [NSExtensionItem] else {
+            return completion(filesName)
+        }
+        
+        for item : NSExtensionItem in inputItems {
+            if let attachments = item.attachments {
+                if attachments.isEmpty { continue }
+                for (_, itemProvider) in (attachments.enumerated()) {
+                    if itemProvider.hasItemConformingToTypeIdentifier(kUTTypeItem as String) || itemProvider.hasItemConformingToTypeIdentifier("public.url") {
+                        itemsProvider.append(itemProvider)
+                    }
                 }
             }
+        }
+        
+        CCUtility.emptyTemporaryDirectory()
+        dateFormatter.dateFormat = "yyyy-MM-dd HH-mm-ss-"
+        
+        for itemProvider in itemsProvider {
+                        
+            var typeIdentifier = ""
+            if itemProvider.hasItemConformingToTypeIdentifier(kUTTypeItem as String) { typeIdentifier = kUTTypeItem as String }
+            if itemProvider.hasItemConformingToTypeIdentifier("public.url") { typeIdentifier = "public.url" }
+
+            itemProvider.loadItem(forTypeIdentifier: typeIdentifier, options: nil, completionHandler: {(item, error) -> Void in
+                                                                                
+                if error == nil {
+
+                    var fileNameOriginal: String?
+
+                    if let url = item as? NSURL {
+                        if FileManager.default.fileExists(atPath: url.path ?? "") {
+                            fileNameOriginal = url.lastPathComponent!
+                        } else if url.scheme?.lowercased().contains("http") == true {
+                            fileNameOriginal = "\(dateFormatter.string(from: Date()))\(conuter).html"
+                        } else {
+                            fileNameOriginal = "\(dateFormatter.string(from: Date()))\(conuter)"
+                        }
+                    }
+                                                        
+                    if let image = item as? UIImage {
+                       getItem(image: image, fileNameOriginal: fileNameOriginal)
+                    }
+                    
+                    if let url = item as? URL {
+                        getItem(url: url as NSURL, fileNameOriginal: fileNameOriginal)
+                    }
+                    
+                    if let data = item as? Data {
+                        getItem(data: data, fileNameOriginal: fileNameOriginal, description: itemProvider.description)
+                    }
+                    
+                    if let string = item as? NSString {
+                        getItem(string: string, fileNameOriginal: fileNameOriginal)
+                    }
+                }
+                
+                conuter += 1
+                if conuter == itemsProvider.count {
+                    completion(filesName)
+                }
+            })
+        }
+    }
+}
+
+/*
+let task = URLSession.shared.downloadTask(with: urlitem) { localURL, urlResponse, error in
+    
+    if let localURL = localURL {
+        
+        if fileNameOriginal != nil {
+            fileName =  fileNameOriginal!
         } else {
-            completion(filesName, outError)
+            let ext = url.pathExtension
+            fileName = "\(dateFormatter.string(from: Date()))\(conuter)." + ext
+        }
+        
+        let filenamePath = NSTemporaryDirectory() + fileName
+      
+        do {
+            try FileManager.default.removeItem(atPath: filenamePath)
         }
+        catch { }
+        
+        do {
+            try FileManager.default.copyItem(atPath: localURL.path, toPath:filenamePath)
+            
+            do {
+                let attr : NSDictionary? = try FileManager.default.attributesOfItem(atPath: filenamePath) as NSDictionary?
+                
+                if let _attr = attr {
+                    if _attr.fileSize() > 0 {
+                        
+                        filesName.append(fileName)
+                    }
+                }
+                
+            } catch let error {
+                outError = error
+            }
+            
+        } catch let error {
+            outError = error
+        }
+    }
+    
+    if index + 1 == attachments.count {
+        completion(filesName, outError)
     }
 }
+task.resume()
+*/
 
 class NCShareExtensionButtonWithIndexPath: UIButton {
     var indexPath:IndexPath?

+ 3 - 3
iOSClient/Brand/Share.plist

@@ -30,13 +30,13 @@
 		<key>NSExtensionAttributes</key>
 		<dict>
 			<key>NSExtensionActivationRule</key>
-			<string>SUBQUERY (extensionItems, $extensionItem, SUBQUERY ($extensionItem.attachments,$attachment,(ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO &quot;public.data&quot;)).@count == $extensionItem.attachments.@count).@count &gt; 0
+			<string>SUBQUERY (extensionItems, $extensionItem, SUBQUERY ($extensionItem.attachments,$attachment,(ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data")).@count == $extensionItem.attachments.@count).@count &gt; 0
             </string>
 		</dict>
-		<key>NSExtensionPointIdentifier</key>
-		<string>com.apple.share-services</string>
 		<key>NSExtensionMainStoryboard</key>
 		<string>MainInterface</string>
+		<key>NSExtensionPointIdentifier</key>
+		<string>com.apple.share-services</string>
 	</dict>
 </dict>
 </plist>

+ 30 - 6
iOSClient/Data/NCManageDatabase.swift

@@ -120,11 +120,6 @@ class NCManageDatabase: NSObject {
                         }
                     }
                     
-                    if oldSchemaVersion < 160 {
-                        migration.deleteData(forType: tableDirectory.className())
-                        migration.deleteData(forType: tableMetadata.className())
-                    }
-                    
                     if oldSchemaVersion < 162 {
                         migration.enumerateObjects(ofType: tableAccount.className()) { oldObject, newObject in
                             newObject!["userId"] = oldObject!["userID"]
@@ -132,6 +127,11 @@ class NCManageDatabase: NSObject {
                         }
                     }
                     
+                    if oldSchemaVersion < 183 {
+                        migration.deleteData(forType: tableDirectory.className())
+                        migration.deleteData(forType: tableMetadata.className())
+                    }
+                    
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
                     
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)
@@ -1669,7 +1669,7 @@ class NCManageDatabase: NSObject {
         return tableLocalFile.init(value: localFile)
     }
     
-    @objc func addLocalFile(metadata: tableMetadata) {
+    func addLocalFile(metadata: tableMetadata) {
         
         let realm = try! Realm()
         
@@ -1693,6 +1693,30 @@ class NCManageDatabase: NSObject {
         }
     }
     
+    func addLocalFile(account: String, etag: String, ocId: String, fileName: String) {
+        
+        let realm = try! Realm()
+        
+        do {
+            try realm.safeWrite {
+            
+                let addObject = tableLocalFile()
+                
+                addObject.account = account
+                addObject.etag = etag
+                addObject.exifDate = NSDate()
+                addObject.exifLatitude = "-1"
+                addObject.exifLongitude = "-1"
+                addObject.ocId = ocId
+                addObject.fileName = fileName
+            
+                realm.add(addObject, update: .all)
+            }
+        } catch let error {
+            NCCommunicationCommon.shared.writeLog("Could not write to database: \(error)")
+        }
+    }
+    
     @objc func deleteLocalFile(predicate: NSPredicate) {
         
         let realm = try! Realm()

+ 0 - 15
iOSClient/Images.xcassets/pause.fill.imageset/Contents.json

@@ -1,15 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "pause.svg",
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  },
-  "properties" : {
-    "preserves-vector-representation" : true
-  }
-}

+ 0 - 1
iOSClient/Images.xcassets/pause.fill.imageset/pause.svg

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M14,19H18V5H14M6,19H10V5H6V19Z" /></svg>

+ 0 - 15
iOSClient/Images.xcassets/play.fill.imageset/Contents.json

@@ -1,15 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "play.svg",
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  },
-  "properties" : {
-    "preserves-vector-representation" : true
-  }
-}

+ 0 - 1
iOSClient/Images.xcassets/play.fill.imageset/play.svg

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M8,5.14V19.14L19,12.14L8,5.14Z" /></svg>

+ 0 - 0
iOSClient/Images.xcassets/mediaPlay.imageset/Contents.json → iOSClient/Images.xcassets/play.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/mediaPlay.imageset/play.png → iOSClient/Images.xcassets/play.imageset/play.png


+ 143 - 23
iOSClient/Main/NCFunctionCenter.swift

@@ -226,6 +226,8 @@ import Queuer
     
     func openActivityViewController(selectOcId: [String]) {
         
+        NCUtility.shared.startActivityIndicator(backgroundView: nil, blurEffect: true)
+        
         DispatchQueue.global().async {
             
             var error: Int = 0
@@ -265,6 +267,7 @@ import Queuer
                     self.appDelegate.window?.rootViewController?.present(activityViewController, animated: true)
                 }
             }
+            NCUtility.shared.stopActivityIndicator()
         }
     }
         
@@ -440,39 +443,156 @@ import Queuer
     }
 
     func pastePasteboard(serverUrl: String) {
+    
+        var pasteboardTypes: [String] = []
+        
+        func upload(pasteboardType : String?, data: Data?) -> Bool {
+            
+            guard let data = data else { return false}
+            guard let pasteboardType = pasteboardType else { return false }
+            
+            let results = NCCommunicationCommon.shared.getDescriptionFile(inUTI: pasteboardType as CFString)
+            if results.resultExtension == "" { return false }
+            if results.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue {
                 
-        for (index, items) in UIPasteboard.general.items.enumerated() {
-            for item in items {
-                let pasteboardType = item.key
-                if let data = UIPasteboard.general.data(forPasteboardType: pasteboardType, inItemSet: IndexSet([index]))?.first {
-                    let results = NCCommunicationCommon.shared.getDescriptionFile(inUTI: pasteboardType as CFString)
-                    if results.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue {
-                        uploadPasteFile(fileName: results.resultFilename, ext: results.resultExtension, contentType: pasteboardType, serverUrl: serverUrl, data: data)
+                do {
+                    let fileName = results.resultFilename + "_" + CCUtility.getIncrementalNumber() + "." + results.resultExtension
+                    let serverUrlFileName = serverUrl + "/" + fileName
+                    let ocIdUpload = UUID().uuidString
+                    let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(ocIdUpload, fileNameView: fileName)!
+                    try data.write(to: URL(fileURLWithPath: fileNameLocalPath))
+                   
+                    NCUtility.shared.startActivityIndicator(backgroundView: nil, blurEffect: true)
+                    NCCommunication.shared.upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath) { account, ocId, etag, date, size, allHeaderFields, errorCode, errorDescription in
+                        if errorCode == 0 && etag != nil && ocId != nil {
+                            let toPath = CCUtility.getDirectoryProviderStorageOcId(ocId!, fileNameView: fileName)!
+                            NCUtilityFileSystem.shared.moveFile(atPath: fileNameLocalPath, toPath: toPath)
+                            NCManageDatabase.shared.addLocalFile(account: account, etag: etag!, ocId: ocId!, fileName: fileName)
+                            NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced, userInfo: ["serverUrl": serverUrl])
+                        } else {
+                            NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode, forced: false)
+                        }
+                        NCUtility.shared.stopActivityIndicator()
                     }
+                } catch {
+                    return false
                 }
             }
+            return true
         }
-    }
+                
+        for (index, items) in UIPasteboard.general.items.enumerated() {
 
-    private func uploadPasteFile(fileName: String, ext: String, contentType: String, serverUrl: String, data: Data) {
-        
-        do {
-            let fileNameView = fileName + "_" + CCUtility.getIncrementalNumber() + "." + ext
-            let ocId = UUID().uuidString
-            let filePath = CCUtility.getDirectoryProviderStorageOcId(ocId, fileNameView: fileNameView)!
+            for item in items { pasteboardTypes.append(item.key) }
+            
+            // image
+            var filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeImage) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first) { continue }
+            }
+
+            // movie
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeMovie) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
             
-            try data.write(to: URL(fileURLWithPath: filePath))
-           
-            let metadataForUpload = NCManageDatabase.shared.createMetadata(account: appDelegate.account, fileName: fileNameView, fileNameView: fileNameView, ocId: ocId, serverUrl: serverUrl, urlBase: appDelegate.urlBase, url: "", contentType: contentType, livePhoto: false)
+            // audio
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeAudio) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // PDF
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypePDF) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
             
-            metadataForUpload.session = NCNetworking.shared.sessionIdentifierBackground
-            metadataForUpload.sessionSelector = NCGlobal.shared.selectorUploadFile
-            metadataForUpload.size = NCUtilityFileSystem.shared.getFileSize(filePath: filePath)
-            metadataForUpload.status = NCGlobal.shared.metadataStatusWaitUpload
+            // ARCHIVE
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeZipArchive) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
             
-            appDelegate.networkingProcessUpload?.createProcessUploads(metadatas: [metadataForUpload])
+            // DOCX
+            filter = pasteboardTypes.filter({ $0 == "org.openxmlformats.wordprocessingml.document" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
             
-        } catch { }
+            // DOC
+            filter = pasteboardTypes.filter({ $0 == "com.microsoft.word.doc" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // PAGES
+            filter = pasteboardTypes.filter({ $0 == "com.apple.iwork.pages.pages" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // XLSX
+            filter = pasteboardTypes.filter({ $0 == "org.openxmlformats.spreadsheetml.sheet" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // XLS
+            filter = pasteboardTypes.filter({ $0 == "com.microsoft.excel.xls" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // NUMBERS
+            filter = pasteboardTypes.filter({ $0 == "com.apple.iwork.numbers.numbers" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // PPTX
+            filter = pasteboardTypes.filter({ $0 == "org.openxmlformats.presentationml.presentation" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // PPT
+            filter = pasteboardTypes.filter({ $0 == "com.microsoft.powerpoint.ppt" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // KEYNOTE
+            filter = pasteboardTypes.filter({ $0 == "com.apple.iwork.keynote.key" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // MARKDOWN
+            filter = pasteboardTypes.filter({ $0 == "net.daringfireball.markdown" })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // RTF
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeRTF) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            // TEXT
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeText) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+            
+            //HTML
+            filter = pasteboardTypes.filter({ UTTypeConformsTo($0 as CFString, kUTTypeHTML) })
+            if filter.count > 0 {
+                if upload(pasteboardType: filter.first, data: UIPasteboard.general.data(forPasteboardType: filter.first!, inItemSet: IndexSet([index]))?.first)  { continue }
+            }
+        }
     }
     
     // MARK: -

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -108,7 +108,7 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         collectionView.prefetchDataSource = self
         
         cacheImages.cellLivePhotoImage = NCUtility.shared.loadImage(named: "livephoto", color: .white)
-        cacheImages.cellPlayImage = UIImage.init(named: "mediaPlay")!.image(color: .white, size: 50)
+        cacheImages.cellPlayImage = UIImage.init(named: "play")!.image(color: .white, size: 50)
     }
     
     override func viewWillAppear(_ animated: Bool) {

+ 2 - 2
iOSClient/NCGlobal.swift

@@ -79,7 +79,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 182
+    let databaseSchemaVersion: UInt64               = 183
     
     // Intro selector
     //
@@ -119,7 +119,7 @@ class NCGlobal: NSObject {
 
     // Nextcloud unsupported
     //
-    let nextcloud_unsupported_version: Int          = 13
+    let nextcloud_unsupported_version: Int          = 16
     
     // Layout
     //

+ 2 - 4
iOSClient/Networking/NCAutoUpload.swift

@@ -175,8 +175,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                         if selector == NCGlobal.shared.selectorUploadAutoUploadAll {
                             NCContentPresenter.shared.messageNotification("_error_", description: "_error_createsubfolders_upload_", delay: NCGlobal.shared.dismissAfterSecond, type: .error, errorCode: NCGlobal.shared.errorInternalError, forced: true)
                         }
-                        completion(counterItemsUpload)
-                        return
+                        return completion(counterItemsUpload)
                     }
                 }
                 
@@ -343,8 +342,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                     } else if account.autoUploadVideo {
                         predicate = predicateVideo
                     } else {
-                        completion(nil)
-                        return
+                        return completion(nil)
                     }
                     
                     fetchOptions.predicate = predicate

+ 14 - 30
iOSClient/Networking/NCNetworking.swift

@@ -395,8 +395,7 @@ import Queuer
 
         guard let account = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", metadata.account)) else {
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-            completion(NCGlobal.shared.errorInternalError, "Internal error")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "Internal error")
         }
         
         var fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
@@ -436,8 +435,7 @@ import Queuer
                    
                 guard let extractMetadata = extractMetadata else {
                     NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-                    completion(NCGlobal.shared.errorInternalError, "Internal error")
-                    return
+                    return completion(NCGlobal.shared.errorInternalError, "Internal error")
                 }
                        
                 fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(extractMetadata.ocId, fileNameView: extractMetadata.fileNameView)
@@ -672,15 +670,13 @@ import Queuer
 
         if metadata.session.count == 0 {
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
-            completion()
-            return
+            return completion()
         }
 
         if metadata.session == NCCommunicationCommon.shared.sessionIdentifierDownload {
             
             NCNetworking.shared.cancelDownload(ocId: metadata.ocId, serverUrl: metadata.serverUrl, fileNameView: metadata.fileNameView)
-            completion()
-            return
+            return completion()
         }
         
         if metadata.session == NCCommunicationCommon.shared.sessionIdentifierUpload {
@@ -695,8 +691,7 @@ import Queuer
                 NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl, "account":metadata.account])
             }
             
-            completion()
-            return
+            return completion()
         }
         
         var session: URLSession?
@@ -708,8 +703,7 @@ import Queuer
         if session == nil {
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadCancelFile, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl, "account":metadata.account])
-            completion()
-            return
+            return completion()
         }
         
         session?.getTasksWithCompletionHandler { (dataTasks, uploadTasks, downloadTasks) in
@@ -875,8 +869,7 @@ import Queuer
             fileNameFolder = NCUtilityFileSystem.shared.createFileName(fileNameFolder, serverUrl: serverUrl, account: account)
         }
         if fileNameFolder.count == 0 {
-            completion(0, "")
-            return
+            return completion(0, "")
         }
         let fileNameFolderUrl = serverUrl + "/" + fileNameFolder
         
@@ -971,9 +964,7 @@ import Queuer
             
                 NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDeleteFile, userInfo: ["ocId": metadata.ocId, "fileNameView": metadata.fileNameView, "typeFile": metadata.typeFile, "onlyLocal": true])
             }
-            completion(0, "")
-            
-            return
+            return completion(0, "")
         }
         
         let isDirectoryEncrypted = CCUtility.isFolderEncrypted(metadata.serverUrl, e2eEncrypted: metadata.e2eEncrypted, account: metadata.account, urlBase: urlBase)
@@ -1013,9 +1004,7 @@ import Queuer
         // verify permission
         let permission = NCUtility.shared.permissionsContainsString(metadata.permissions, permissions: NCGlobal.shared.permissionCanDelete)
         if metadata.permissions != "" && permission == false {
-            
-            completion(NCGlobal.shared.errorInternalError, "_no_permission_delete_file_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_no_permission_delete_file_")
         }
                 
         let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
@@ -1146,16 +1135,13 @@ import Queuer
         
         let permission = NCUtility.shared.permissionsContainsString(metadata.permissions, permissions: NCGlobal.shared.permissionCanRename)
         if !(metadata.permissions == "") && !permission {
-            completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
         }
         guard let fileNameNew = CCUtility.removeForbiddenCharactersServer(fileNameNew) else {
-            completion(0, "")
-            return
+            return completion(0, "")
         }
         if fileNameNew.count == 0 || fileNameNew == metadata.fileNameView {
-            completion(0, "")
-            return
+            return completion(0, "")
         }
         
         let fileNamePath = metadata.serverUrl + "/" + metadata.fileName
@@ -1231,8 +1217,7 @@ import Queuer
     
         let permission = NCUtility.shared.permissionsContainsString(metadata.permissions, permissions: NCGlobal.shared.permissionCanRename)
         if !(metadata.permissions == "") && !permission {
-            completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
         }
         
         let serverUrlFrom = metadata.serverUrl
@@ -1277,8 +1262,7 @@ import Queuer
     
         let permission = NCUtility.shared.permissionsContainsString(metadata.permissions, permissions: NCGlobal.shared.permissionCanRename)
         if !(metadata.permissions == "") && !permission {
-            completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_no_permission_modify_file_")
         }
         
         let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName

+ 1 - 2
iOSClient/Networking/NCNetworkingChunkedUpload.swift

@@ -50,8 +50,7 @@ extension NCNetworking {
                 
                 NCContentPresenter.shared.messageNotification("_error_", description: "_err_file_not_found_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode:NCGlobal.shared.errorReadFile, forced: true)
                 NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))                
-                completion(uploadErrorCode, uploadErrorDescription)
-                return
+                return completion(uploadErrorCode, uploadErrorDescription)
             }
             
         } else {

+ 8 - 16
iOSClient/Networking/NCNetworkingE2EE.swift

@@ -43,8 +43,7 @@ import Alamofire
         
         fileNameFolder = NCUtilityFileSystem.shared.createFileName(fileNameFolder, serverUrl: serverUrl, account: account)
         if fileNameFolder.count == 0 {
-            completion(0, "")
-            return
+            return completion(0, "")
         }
         fileNameIdentifier = CCUtility.generateRandomIdentifier()
         fileNameFolderUrl = serverUrl + "/" + fileNameIdentifier
@@ -59,8 +58,7 @@ import Alamofire
                             if let tableLock = NCManageDatabase.shared.getE2ETokenLock(account: account, serverUrl: serverUrl) {
                                 NCCommunication.shared.lockE2EEFolder(fileId: tableLock.fileId, e2eToken: tableLock.e2eToken, method: "DELETE") { (_, _, _, _) in }
                             }
-                            completion(NCGlobal.shared.errorInternalError, "Error convert ocId")
-                            return
+                            return completion(NCGlobal.shared.errorInternalError, "Error convert ocId")
                         }
                         NCCommunication.shared.markE2EEFolder(fileId: fileId, delete: false) { (account, errorCode, errorDescription) in
                             if errorCode == 0 {
@@ -207,8 +205,7 @@ import Alamofire
 
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId":metadata.ocId, "ocIdTemp":ocIdTemp, "errorCode":NCGlobal.shared.errorInternalError, "errorDescription":"E2E Error file too big"])
             start()
-            completion(NCGlobal.shared.errorInternalError, "E2E Error file too big")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "E2E Error file too big")
         }
         
         // Update metadata
@@ -228,8 +225,7 @@ import Alamofire
             NCManageDatabase.shared.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", ocIdTemp))
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUploadedFile, userInfo: ["ocId":metadata.ocId, "ocIdTemp":ocIdTemp, "errorCode":NCGlobal.shared.errorInternalError, "errorDescription":"_e2e_error_create_encrypted_"])
             start()
-            completion(NCGlobal.shared.errorInternalError, "_e2e_error_create_encrypted_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_e2e_error_create_encrypted_")
         }
         
         if let result = NCManageDatabase.shared.getE2eEncryption(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, serverUrl)) {
@@ -258,8 +254,7 @@ import Alamofire
             metadata = getMetadata
         } else {
             start()
-            completion(NCGlobal.shared.errorInternalError, "_e2e_error_create_encrypted_")
-            return
+            return completion(NCGlobal.shared.errorInternalError, "_e2e_error_create_encrypted_")
         }
         
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["ocId":metadata.ocId, "serverUrl":metadata.serverUrl])
@@ -368,8 +363,7 @@ import Alamofire
         var e2eToken: String?
         
         guard let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl)) else {
-            completion(nil, nil, 0, "")
-            return
+            return completion(nil, nil, 0, "")
         }
         
         if let tableLock = NCManageDatabase.shared.getE2ETokenLock(account: account, serverUrl: serverUrl) {
@@ -389,8 +383,7 @@ import Alamofire
         var e2eToken: String?
         
         guard let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl)) else {
-            completion(nil, nil, 0, "")
-            return
+            return completion(nil, nil, 0, "")
         }
         
         if let tableLock = NCManageDatabase.shared.getE2ETokenLock(account: account, serverUrl: serverUrl) {
@@ -416,8 +409,7 @@ import Alamofire
                     
                     if errorCode == 0 && e2eMetadata != nil {
                         if !NCEndToEndMetadata.shared.decoderMetadata(e2eMetadata!, privateKey: CCUtility.getEndToEndPrivateKey(account), serverUrl: serverUrl, account: account, urlBase: urlBase) {
-                            completion(e2eToken, NCGlobal.shared.errorInternalError, NSLocalizedString("_e2e_error_encode_metadata_", comment: ""))
-                            return
+                            return completion(e2eToken, NCGlobal.shared.errorInternalError, NSLocalizedString("_e2e_error_encode_metadata_", comment: ""))
                         }
                         method = "PUT"
                     }

+ 3 - 6
iOSClient/Utility/CCUtility.m

@@ -1352,8 +1352,7 @@
 + (void)extractImageVideoFromAssetLocalIdentifierForUpload:(tableMetadata *)metadataForUpload notification:(BOOL)notification completion:(void(^)(tableMetadata *metadata, NSString* fileNamePath))completion
 {
     if (metadataForUpload == nil) {
-        completion(nil, nil);
-        return;
+        return completion(nil, nil);
     }
     
     tableMetadata *metadata = [[NCManageDatabase shared] copyObjectWithMetadata:metadataForUpload];
@@ -1364,8 +1363,7 @@
             [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(NCGlobal.shared.errorInternalError), @"errorDescription": @"_err_file_not_found_"}];
         }
         
-        completion(nil, nil);
-        return;
+        return completion(nil, nil);
     }
     
     PHAsset *asset = result[0];
@@ -1390,8 +1388,7 @@
                         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Image request iCloud failed [%@]", error.description]}];
                     }
                     
-                    completion(nil, nil);
-                    return;
+                    return completion(nil, nil);
                 }
             };
             

+ 2 - 4
iOSClient/Utility/NCLivePhoto.swift

@@ -140,8 +140,7 @@ class NCLivePhoto {
         }
         group.notify(queue: DispatchQueue.main) {
             guard let pairedPhotoURL = keyPhotoURL, let pairedVideoURL = videoURL else {
-                completion(nil)
-                return
+                return completion(nil)
             }
             completion((pairedPhotoURL, pairedVideoURL))
         }
@@ -196,8 +195,7 @@ class NCLivePhoto {
         let videoAsset = AVURLAsset(url: videoURL)
         let frameCount = videoAsset.countFrames(exact: false)
         guard let videoTrack = videoAsset.tracks(withMediaType: .video).first else {
-            completion(nil)
-            return
+            return completion(nil)
         }
         do {
             // Create the Asset Writer

+ 24 - 0
iOSClient/Utility/NCUtility.swift

@@ -404,6 +404,30 @@ class NCUtility: NSObject {
         return UIImage(cgImage: thumbnailImageRef)
     }
     
+    func imageFromVideo(url: URL, at time: TimeInterval, completion: @escaping (UIImage?) -> Void) {
+        DispatchQueue.global(qos: .background).async {
+            
+            let asset = AVURLAsset(url: url)
+            let assetIG = AVAssetImageGenerator(asset: asset)
+            
+            assetIG.appliesPreferredTrackTransform = true
+            assetIG.apertureMode = AVAssetImageGenerator.ApertureMode.encodedPixels
+
+            let cmTime = CMTime(seconds: time, preferredTimescale: 60)
+            let thumbnailImageRef: CGImage
+            do {
+                thumbnailImageRef = try assetIG.copyCGImage(at: cmTime, actualTime: nil)
+            } catch let error {
+                print("Error: \(error)")
+                return completion(nil)
+            }
+
+            DispatchQueue.main.async {
+                completion(UIImage(cgImage: thumbnailImageRef))
+            }
+        }
+    }
+    
     func createImageFrom(fileName: String, ocId: String, etag: String, typeFile: String) {
         
         var originalImage, scaleImagePreview, scaleImageIcon: UIImage?

+ 18 - 0
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -265,6 +265,19 @@ class NCUtilityFileSystem: NSObject {
         
         let minimumDate = Date().addingTimeInterval(-days*24*60*60)
         let url = URL(fileURLWithPath: directory)
+        var offlineDir: [String] = []
+        var offlineFiles: [String] = []
+
+        if let directories = NCManageDatabase.shared.getTablesDirectory(predicate: NSPredicate(format: "offline == true"), sorted: "serverUrl", ascending: true) {
+            for directory: tableDirectory in directories {
+                offlineDir.append(CCUtility.getDirectoryProviderStorageOcId(directory.ocId))
+            }
+        }
+       
+        let files = NCManageDatabase.shared.getTableLocalFiles(predicate: NSPredicate(format: "offline == true"), sorted: "fileName", ascending: true)
+        for file: tableLocalFile in files {
+            offlineFiles.append(CCUtility.getDirectoryProviderStorageOcId(file.ocId, fileNameView: file.fileName))
+        }
         
         func meetsRequirement(date: Date) -> Bool {
             return date < minimumDate
@@ -278,6 +291,11 @@ class NCUtilityFileSystem: NSObject {
                         if attributes[.size] as? Double == 0 { continue }
                         if attributes[.type] as? FileAttributeType == FileAttributeType.typeDirectory { continue }
                         if fileURL.pathExtension == NCGlobal.shared.extensionPreview { continue }
+                        // check offline
+                        if offlineFiles.contains(fileURL.path) { continue }
+                        let filter = offlineDir.filter({ fileURL.path.hasPrefix($0)})
+                        if filter.count > 0 { continue }
+                        // check date
                         if meetsRequirement(date: date) {
                             let folderURL = fileURL.deletingLastPathComponent()
                             let ocId = folderURL.lastPathComponent