[gnome-music/freeze-break: 91/107] query: Add new query to get song using a url
- From: Arnel A. Borja <arnelborja src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/freeze-break: 91/107] query: Add new query to get song using a url
- Date: Wed, 11 Sep 2013 13:22:01 +0000 (UTC)
commit 528b84ca890536c74237de24eb04db3dcc3954e6
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Sun Sep 8 19:32:15 2013 +0800
query: Add new query to get song using a url
gnomemusic/query.py | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index e40eb8a..dc80a3a 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -272,3 +272,24 @@ class Query():
}
""".replace("\n", " ").strip() % {'album_id': album_id}
return query
+
+ @staticmethod
+ def get_song_with_url(url):
+ query = '''
+ SELECT DISTINCT
+ rdf:type(?song)
+ tracker:id(?song) AS id
+ nie:url(?song) AS url
+ nie:title(?song) AS title
+ nmm:artistName(nmm:performer(?song)) AS artist
+ nie:title(nmm:musicAlbum(?song)) AS album
+ nfo:duration(?song) AS duration
+ WHERE {
+ ?song a nmm:MusicPiece .
+ FILTER (
+ nie:url(?song) = '%(url)s'
+ )
+ }
+ '''.replace('\n', ' ').strip() % {'url': url}
+
+ return query
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]