[gnome-music] query: Fix searches with respect to composer
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] query: Fix searches with respect to composer
- Date: Mon, 19 Mar 2018 23:34:47 +0000 (UTC)
commit 09af8980bddefd99e903084b1afbc4ab5e0b839c
Author: Subhadip Jana <subhadip1997a gmail com>
Date: Sun Mar 18 14:24:09 2018 +0530
query: Fix searches with respect to composer
Searching for a composer in the default search mode
retrieved no results. Modified the sparql query to
return items having the composer name.
Fixes https://gitlab.gnome.org/GNOME/gnome-music/issues/140
gnomemusic/query.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 820d2b44..89bfd622 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -828,13 +828,16 @@ class Query():
BIND(tracker:normalize(nie:title(nmm:musicAlbum(?song)), 'nfkd') AS ?match1) .
BIND(tracker:normalize(nmm:artistName(nmm:performer(?song)), 'nfkd') AS ?match2) .
BIND(tracker:normalize(nie:title(?song), 'nfkd') AS ?match3) .
+ BIND(tracker:normalize(nmm:composer(?song), 'nfkd') AS ?match4) .
FILTER (
CONTAINS(tracker:case-fold(tracker:unaccent(?match1)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match1), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match2)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match2), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match3)), "%(name)s") ||
- CONTAINS(tracker:case-fold(?match3), "%(name)s")
+ CONTAINS(tracker:case-fold(?match3), "%(name)s") ||
+ CONTAINS(tracker:case-fold(tracker:unaccent(?match4)), "%(name)s") ||
+ CONTAINS(tracker:case-fold(?match4), "%(name)s")
)
}
}
@@ -887,13 +890,16 @@ class Query():
BIND(tracker:normalize(nie:title(nmm:musicAlbum(?song)), 'nfkd') AS ?match1) .
BIND(tracker:normalize(nmm:artistName(nmm:performer(?song)), 'nfkd') AS ?match2) .
BIND(tracker:normalize(nie:title(?song), 'nfkd') AS ?match3) .
+ BIND(tracker:normalize(nmm:composer(?song), 'nfkd') AS ?match4) .
FILTER (
CONTAINS(tracker:case-fold(tracker:unaccent(?match1)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match1), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match2)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match2), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match3)), "%(name)s") ||
- CONTAINS(tracker:case-fold(?match3), "%(name)s")
+ CONTAINS(tracker:case-fold(?match3), "%(name)s") ||
+ CONTAINS(tracker:case-fold(tracker:unaccent(?match4)), "%(name)s") ||
+ CONTAINS(tracker:case-fold(?match4), "%(name)s")
)
}
}
@@ -946,13 +952,16 @@ class Query():
BIND(tracker:normalize(nie:title(nmm:musicAlbum(?song)), 'nfkd') AS ?match1) .
BIND(tracker:normalize(nmm:artistName(nmm:performer(?song)), 'nfkd') AS ?match2) .
BIND(tracker:normalize(nie:title(?song), 'nfkd') AS ?match3) .
+ BIND(tracker:normalize(nmm:composer(?song), 'nfkd') AS ?match4) .
FILTER (
CONTAINS(tracker:case-fold(tracker:unaccent(?match1)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match1), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match2)), "%(name)s") ||
CONTAINS(tracker:case-fold(?match2), "%(name)s") ||
CONTAINS(tracker:case-fold(tracker:unaccent(?match3)), "%(name)s") ||
- CONTAINS(tracker:case-fold(?match3), "%(name)s")
+ CONTAINS(tracker:case-fold(?match3), "%(name)s") ||
+ CONTAINS(tracker:case-fold(tracker:unaccent(?match4)), "%(name)s") ||
+ CONTAINS(tracker:case-fold(?match4), "%(name)s")
)
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]