[gnome-music/gnome-3-16] query: filter out urls which are outside Music and Downloads in playlists too
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gnome-3-16] query: filter out urls which are outside Music and Downloads in playlists too
- Date: Thu, 28 May 2015 09:00:34 +0000 (UTC)
commit 3e96649d2e67e489945d0cedc17b2baffef66c97
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Thu May 28 10:53:13 2015 +0200
query: filter out urls which are outside Music and Downloads in playlists too
https://bugzilla.gnome.org/show_bug.cgi?id=749981
gnomemusic/query.py | 67 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 62 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 7dc7cad..fa51184 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -980,8 +980,19 @@ class Query():
nie:usageCounter ?count ;
nie:isStoredAs ?as .
?as nie:url ?url .
+ FILTER (
+ tracker:uri-is-descendant(
+ '%(music_dir)s', nie:url(?song)
+ ) ||
+ tracker:uri-is-descendant(
+ '%(download_dir)s', nie:url(?song)
+ )
+ )
} ORDER BY DESC(?count) LIMIT 50
- """.replace('\n', ' ').strip()
+ """.replace('\n', ' ').strip() % {
+ 'music_dir': Query.MUSIC_URI,
+ 'download_dir': Query.DOWNLOAD_URI
+ }
return query
@@ -994,8 +1005,19 @@ class Query():
nie:isStoredAs ?as .
?as nie:url ?url .
FILTER ( NOT EXISTS { ?song nie:usageCounter ?count .} )
+ FILTER (
+ tracker:uri-is-descendant(
+ '%(music_dir)s', nie:url(?song)
+ ) ||
+ tracker:uri-is-descendant(
+ '%(download_dir)s', nie:url(?song)
+ )
+ )
} ORDER BY nfo:fileLastAccessed(?song) LIMIT 50
- """.replace('\n', ' ').strip()
+ """.replace('\n', ' ').strip() % {
+ 'music_dir': Query.MUSIC_URI,
+ 'download_dir': Query.DOWNLOAD_URI
+ }
return query
@@ -1017,8 +1039,20 @@ class Query():
?as nie:url ?url .
FILTER ( ?last_played > '%(compare_date)s'^^xsd:dateTime )
FILTER ( EXISTS { ?song nie:usageCounter ?count .} )
+ FILTER (
+ tracker:uri-is-descendant(
+ '%(music_dir)s', nie:url(?song)
+ ) ||
+ tracker:uri-is-descendant(
+ '%(download_dir)s', nie:url(?song)
+ )
+ )
} ORDER BY DESC(?last_played) LIMIT 50
- """.replace('\n', ' ').strip() % {'compare_date': compare_date}
+ """.replace('\n', ' ').strip() % {
+ 'compare_date': compare_date,
+ 'music_dir': Query.MUSIC_URI,
+ 'download_dir': Query.DOWNLOAD_URI
+ }
return query
@@ -1040,8 +1074,20 @@ class Query():
tracker:added ?added .
?as nie:url ?url .
FILTER ( ?added > '%(compare_date)s'^^xsd:dateTime )
+ FILTER (
+ tracker:uri-is-descendant(
+ '%(music_dir)s', nie:url(?song)
+ ) ||
+ tracker:uri-is-descendant(
+ '%(download_dir)s', nie:url(?song)
+ )
+ )
} ORDER BY DESC(?added) LIMIT 50
- """.replace('\n', ' ').strip() % {'compare_date': compare_date}
+ """.replace('\n', ' ').strip() % {
+ 'compare_date': compare_date,
+ 'music_dir': Query.MUSIC_URI,
+ 'download_dir': Query.DOWNLOAD_URI
+ }
return query
@@ -1053,8 +1099,19 @@ class Query():
nie:isStoredAs ?as ;
nao:hasTag nao:predefined-tag-favorite .
?as nie:url ?url .
+ FILTER (
+ tracker:uri-is-descendant(
+ '%(music_dir)s', nie:url(?song)
+ ) ||
+ tracker:uri-is-descendant(
+ '%(download_dir)s', nie:url(?song)
+ )
+ )
} ORDER BY DESC(tracker:added(?song))
- """.replace('\n', ' ').strip()
+ """.replace('\n', ' ').strip() % {
+ 'music_dir': Query.MUSIC_URI,
+ 'download_dir': Query.DOWNLOAD_URI
+ }
return query
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]