[gnome-music] query: Use sparql 1.1 syntax on order_by_statement()



commit 7eff30aa426b2c390342160c847d7dc6538ce8d0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Dec 31 19:11:38 2015 +0100

    query: Use sparql 1.1 syntax on order_by_statement()
    
    We now implicitly rely on the given term to be lower cased, because
    it's now preemptively lowercased in the places calling this function.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759587

 gnomemusic/query.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 9dd9280..6655b49 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -84,8 +84,8 @@ class Query():
         # list should include 'the' regardless of language. If some articles occur more
         # frequently than others, most common should appear first, least common last.
         for article in reversed(_("the a an").split(" ")):
-            return_statement = '''IF(fn:starts-with(fn:lower-case(%(attribute)s), "%(article)s"),
-            fn:substring(fn:lower-case(%(attribute)s), %(substr_start)s),
+            return_statement = '''IF(STRSTARTS(%(attribute)s, "%(article)s"),
+            SUBSTR(%(attribute)s, %(substr_start)s),
             %(nested_if)s)''' % {
                 'attribute': attr,
                 'article': article + " ",


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