[gnome-books] query: Coalesce the title and filename to get consistent ordering



commit 8c8125d1364039aaf8318104ec4f6a2841ce9389
Author: IBBoard <dev ibboard co uk>
Date:   Sun Apr 21 17:16:24 2019 +0100

    query: Coalesce the title and filename to get consistent ordering
    
    This should make tracker order (by title, or by file name if
    no title) match the UI order (by "title", which uses the file
    name if there is not title).
    
    Closes: #6

 src/query.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/query.js b/src/query.js
index ae694479..ce7928cd 100644
--- a/src/query.js
+++ b/src/query.js
@@ -162,7 +162,7 @@ var QueryBuilder = new Lang.Class({
 
             switch (sortBy) {
             case Gd.MainColumns.PRIMARY_TEXT:
-                tailSparql += 'ASC(?title) ASC(?filename)';
+                tailSparql += 'ASC(tracker:coalesce(?title, ?filename))';
                 break;
             case Gd.MainColumns.SECONDARY_TEXT:
                 tailSparql += 'ASC(?author)';


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]