[gnome-music/wip/jfelder/playlists-core-rewrite-prep-work: 2/24] query: Remove unused method clear_playlist
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/playlists-core-rewrite-prep-work: 2/24] query: Remove unused method clear_playlist
- Date: Wed, 3 Jul 2019 16:48:01 +0000 (UTC)
commit 72a7173b853cb2debfa515b7910b0c8606a7645c
Author: Jean Felder <jfelder src gnome org>
Date: Tue Jul 2 14:12:28 2019 +0200
query: Remove unused method clear_playlist
Query has already a method called clear_playlist_with_id which does
exactly the same thing. Both method have been introduced by the same
commit but clear_playlist has never been used.
gnomemusic/query.py | 37 -------------------------------------
1 file changed, 37 deletions(-)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 227c5f16..b4a1784b 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -998,40 +998,3 @@ class Query():
query = """?song fts:match '"nie:title" : %(name)s*' . """.replace('\n', ' ').strip() % {'name':
name}
return Query.songs(query)
-
- @staticmethod
- def clear_playlist(playlist_id):
- # TODO is there a way to do this with only one FILTER statement?
-
- query = """
- DELETE {
- ?playlist
- nfo:hasMediaFileListEntry ?entry .
- ?entry
- a rdfs:Resource .
- }
- WHERE {
- ?playlist
- a nmm:Playlist ;
- a nfo:MediaList ;
- nfo:hasMediaFileListEntry ?entry .
- FILTER (
- tracker:id(?playlist) = %(playlist_id)s
- )
- }
- INSERT OR REPLACE {
- ?playlist nfo:entryCounter '0'
- }
- WHERE {
- ?playlist
- a nmm:Playlist ;
- a nfo:MediaList .
- FILTER (
- tracker:id(?playlist) = %(playlist_id)s
- )
- }
- """.replace("\n", " ").strip() % {
- 'playlist_id': playlist_id
- }
-
- return query
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]