Эх сурвалжийг харах

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 жил өмнө
parent
commit
ec38c623d8

+ 12 - 12
iOSClient/Data/NCDataSource.swift

@@ -93,6 +93,17 @@ class NCDataSource: NSObject {
 
     internal func createSections() {
 
+        for metadata in metadatasSource {
+            // skipped livePhoto
+            if filterLivePhoto && metadata.livePhoto && metadata.ext == "mov" {
+                continue
+            }
+            let section = NSLocalizedString(self.getSectionValue(metadata: metadata), comment: "").lowercased().firstUppercased
+            if !self.sectionsValue.contains(section) {
+                self.sectionsValue.append(section)
+            }
+        }
+        
         if let providers = self.providers, !providers.isEmpty {
             var sectionsDictionary: [String:Int] = [:]
             for section in self.sectionsValue {
@@ -110,19 +121,8 @@ class NCDataSource: NSObject {
                     self.sectionsValue.append(section.key)
                 }
             }
-            
-        } else {
 
-            for metadata in metadatasSource {
-                // skipped livePhoto
-                if filterLivePhoto && metadata.livePhoto && metadata.ext == "mov" {
-                    continue
-                }
-                let section = NSLocalizedString(self.getSectionValue(metadata: metadata), comment: "").lowercased().firstUppercased
-                if !self.sectionsValue.contains(section) {
-                    self.sectionsValue.append(section)
-                }
-            }
+        } else {
 
             let directory = NSLocalizedString("directory", comment: "").lowercased().firstUppercased
             self.sectionsValue = self.sectionsValue.sorted {