فهرست منبع

normalized code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 سال پیش
والد
کامیت
5281b2d3b9

+ 15 - 15
iOSClient/Networking/NCNetworkingProcessUpload.swift

@@ -110,6 +110,21 @@ class NCNetworkingProcessUpload: NSObject {
             let counterBadge = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND (status == %d OR status == %d OR status == %d)", self.appDelegate.account, NCGlobal.shared.metadataStatusWaitUpload, NCGlobal.shared.metadataStatusInUpload, NCGlobal.shared.metadataStatusUploading))
             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUpdateBadgeNumber, userInfo: ["counter":counterBadge.count])
 
+            // ** TEST ONLY ONE **
+            // E2EE
+            let uniqueMetadatas = metadatasUpload.unique(map: { $0.serverUrl })
+            for metadata in uniqueMetadatas {
+                if NCUtility.shared.isDirectoryE2EE(metadata: metadata) {
+                    self.pauseProcess = false
+                    return completition(counterUpload)
+                }
+            }
+            // CHUNK
+            if metadatasUpload.filter({ $0.chunk }).count > 0 {
+                self.pauseProcess = false
+                return completition(counterUpload)
+            }
+
             NCNetworking.shared.getOcIdInBackgroundSession(queue: queue, completion: { listOcId in
 
                 for sessionSelector in sessionSelectors where counterUpload < maxConcurrentOperationUpload {
@@ -128,21 +143,6 @@ class NCNetworkingProcessUpload: NSObject {
                             continue
                         }
 
-                        // Chunk only one
-                        if metadatasUpload.filter({ $0.chunk }).count > 0 {
-                            continue
-                        }
-
-                        // E2EE only one
-                        let uniqueMetadatas = metadatasUpload.unique(map: { $0.serverUrl })
-                        var alreadyPresentE2EE: Bool = false
-                        for metadata in uniqueMetadatas where alreadyPresentE2EE == false {
-                            if NCUtility.shared.isDirectoryE2EE(metadata: metadata) {alreadyPresentE2EE = true }
-                        }
-                        if alreadyPresentE2EE {
-                            continue
-                        }
-
                         // Session Extension ? skipped
                         if metadata.session == NCNetworking.shared.sessionIdentifierBackgroundExtension {
                             continue

+ 12 - 0
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift

@@ -43,6 +43,12 @@ class NCViewerMediaPage: UIViewController {
         return self.pageViewController.viewControllers![0] as! NCViewerMedia
     }
 
+    private var hideStatusBar: Bool = false {
+        didSet {
+            setNeedsStatusBarAppearanceUpdate()
+        }
+    }
+
     var metadatas: [tableMetadata] = []
     var modifiedOcId: [String] = []
     var currentIndex = 0
@@ -151,6 +157,10 @@ class NCViewerMediaPage: UIViewController {
         return currentScreenMode == .full
     }
 
+    override var prefersStatusBarHidden: Bool {
+        return hideStatusBar
+    }
+
     // MARK: -
     
     func getViewerMedia(index: Int, metadata: tableMetadata) -> NCViewerMedia {
@@ -181,6 +191,7 @@ class NCViewerMediaPage: UIViewController {
         if mode == .normal {
 
             navigationController?.setNavigationBarHidden(false, animated: true)
+            hideStatusBar = false
             progressView.isHidden = false
 
             if !currentViewController.detailView.isShow() {
@@ -194,6 +205,7 @@ class NCViewerMediaPage: UIViewController {
         } else {
 
             navigationController?.setNavigationBarHidden(true, animated: true)
+            hideStatusBar = true
             progressView.isHidden = true
 
             currentViewController.playerToolBar?.hide()

+ 2 - 2
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -400,12 +400,12 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
 
         if navigationController?.isNavigationBarHidden ?? false {
             navigationController?.setNavigationBarHidden(false, animated: true)
-            self.hideStatusBar = false
+            hideStatusBar = false
             pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor)
 
         } else {
             navigationController?.setNavigationBarHidden(true, animated: true)
-            self.hideStatusBar = true
+            hideStatusBar = true
             pdfThumbnailScrollViewTopAnchor = pdfThumbnailScrollView.topAnchor.constraint(equalTo: view.topAnchor)
         }