Browse Source

fix order Media view

marinofaggiana 6 năm trước cách đây
mục cha
commit
f720ac5912
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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
         }