浏览代码

fix order Media view

marinofaggiana 6 年之前
父节点
当前提交
f720ac5912
共有 1 个文件被更改,包括 2 次插入1 次删除
  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
         }