Selaa lähdekoodia

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 vuotta sitten
vanhempi
commit
9829736781
1 muutettua tiedostoa jossa 13 lisäystä ja 11 poistoa
  1. 13 11
      iOSClient/Data/NCDataSource.swift

+ 13 - 11
iOSClient/Data/NCDataSource.swift

@@ -93,17 +93,6 @@ 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 {
@@ -121,7 +110,20 @@ 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)
+                }
+            }
+
             let directory = NSLocalizedString("directory", comment: "").lowercased().firstUppercased
             self.sectionsValue = self.sectionsValue.sorted {
                 if directoryOnTop && $0 == directory {