[gnome-music/wip/mschraal/filter-playlists] query: Filter out on-disk playlist formats



commit 356c7e9afad518d80915cfc91a07329f23f9c95a
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Feb 20 14:01:35 2018 +0100

    query: Filter out on-disk playlist formats
    
    Filter out .m3u, .m3u8 and .pls playlist. They show up inconsistently
    and there is no good use case for showing them at this time.
    
    Closes: #72, #151

 gnomemusic/query.py | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gnomemusic/query.py b/gnomemusic/query.py
index 49b0af4..53f044c 100644
--- a/gnomemusic/query.py
+++ b/gnomemusic/query.py
@@ -235,6 +235,10 @@ class Query():
                        tracker:available ?available . }
             FILTER ( (STRSTARTS(?url, '%(music_dir)s/') && ?available)
                       || !BOUND(nfo:belongsToContainer(?playlist)) )
+            FILTER ( !STRENDS(LCASE(?url), '.m3u')
+                     && !STRENDS(LCASE(?url), '.m3u8')
+                     && !STRENDS(LCASE(?url), '.pls')
+                     || !BOUND(nfo:belongsToContainer(?playlist)) )
             OPTIONAL { ?playlist nao:hasTag ?tag }
         }
     ORDER BY DESC(tracker:added(?playlist)) !BOUND(?tag) LCASE(?title)


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