Forráskód Böngészése

fix order Media view

marinofaggiana 6 éve
szülő
commit
f720ac5912
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      iOSClient/Database/NCManageDatabase.swift

+ 2 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -2002,7 +2002,8 @@ class NCManageDatabase: NSObject {
         let realm = try! Realm()
         realm.refresh()
         
-        let results = realm.objects(tableMedia.self).filter(NSPredicate(format: "account == %@", account)).sorted(byKeyPath: "date", ascending: false)
+        let sortProperties = [SortDescriptor(keyPath: "date", ascending: false), SortDescriptor(keyPath: "fileNameView", ascending: false)]
+        let results = realm.objects(tableMedia.self).filter(NSPredicate(format: "account == %@", account)).sorted(by: sortProperties)// d(byKeyPath: "date", ascending: false)
         if results.count == 0 {
             return nil
         }