After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761502 - playlist filter not working, allowing non MUSIC_DIR playlists
playlist filter not working, allowing non MUSIC_DIR playlists
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2016-02-03 13:30 UTC by Marinus Schraal
Modified: 2016-05-10 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make playlist query filter MUSIC_DIR only (824 bytes, patch)
2016-02-03 13:30 UTC, Marinus Schraal
accepted-commit_now Details | Review
special playlists on top (845 bytes, patch)
2016-02-04 13:16 UTC, Marinus Schraal
accepted-commit_now Details | Review
query: Include playlists from Music dir only (1.31 KB, patch)
2016-05-10 20:56 UTC, Marinus Schraal
none Details | Review
query: Order special playlist on top (1.07 KB, patch)
2016-05-10 20:56 UTC, Marinus Schraal
committed Details | Review
query: Include playlists from Music dir only (1.31 KB, patch)
2016-05-10 20:58 UTC, Marinus Schraal
committed Details | Review

Description Marinus Schraal 2016-02-03 13:30:14 UTC
Created attachment 320337 [details] [review]
make playlist query filter MUSIC_DIR only

I noticed the playlist view showed playlists that were not in the MUSIC_DIR. Attached patch remedies that problem.

The former FILTER statement didn't work b/c it was inside the optional bracket.
Taking it outside however has the side effect of not showing the internal playlists, because those have no nie:url and are not tracker:available. I finally figured that nfo:belongsToContainer is not bound for the internal playlist
 and we could check for that.

It's a somewhat convoluted way, but it works.
Comment 1 Marinus Schraal 2016-02-04 13:16:10 UTC
Created attachment 320429 [details] [review]
special playlists on top

this addition to the query orders the internal gnome-music playlists (most played, etc.) on top. I thought it was a bit odd they were just somewhere in the middle of the pack.
Comment 2 Carlos Garnacho 2016-05-09 19:41:39 UTC
Comment on attachment 320337 [details] [review]
make playlist query filter MUSIC_DIR only

Looks fine to me as a workaround, but I think this is a bug in Tracker. Filters within optionals are meant to work, see:

http://www.w3.org/TR/sparql11-query/#OptionalAndConstraints

I'll leave it up to Felipe whether he wants to push this or not. Would be great to fix in Tracker anyway.
Comment 3 Carlos Garnacho 2016-05-09 19:43:39 UTC
Comment on attachment 320429 [details] [review]
special playlists on top

This one looks fine to me. Although notice that the commit also caught some change in libgd, could make sense to remove that from the patch before pushing.
Comment 4 Carlos Garnacho 2016-05-10 11:45:41 UTC
Comment on attachment 320337 [details] [review]
make playlist query filter MUSIC_DIR only

Turns out I was misreading the spec... This patch looks good to me.
Comment 5 Marinus Schraal 2016-05-10 20:56:01 UTC
Created attachment 327613 [details] [review]
query: Include playlists from Music dir only

Tracker queries erronously included playlist from outside the Music
directory. Fix the query to only include playlists from the Music
directory.
Comment 6 Marinus Schraal 2016-05-10 20:56:29 UTC
Created attachment 327614 [details] [review]
query: Order special playlist on top

Use the fact that the auto-generated playlists are tagged to sort them
on top of the list.
Comment 7 Marinus Schraal 2016-05-10 20:58:33 UTC
Created attachment 327615 [details] [review]
query: Include playlists from Music dir only

Tracker queries erroneously included playlist from outside the Music
directory. Fix the query to only include playlists from the Music
directory.