Commit 8641f63f authored by Marinus Schraal's avatar Marinus Schraal

grltrackerplaylists: Add location filter to Playlist

Since 41c60ec7 all the songs in the Playlist are matched to a songs
in the main songs model. The main songs model only contains songs from
the filtered location, so any songs in a playlist outside of this
location crashes Music as the hash match fails.

Add a location filter to the songs queries in Playlist to prevent this
from happening.
parent 85041828
......@@ -401,10 +401,12 @@ class Playlist(GObject.GObject):
NOT EXISTS { ?song a nmm:Video }
&& NOT EXISTS { ?song a nmm:Playlist }
)
%(location_filter)s
}
ORDER BY nfo:listPosition(?entry)
""".replace('\n', ' ').strip() % {
'filter_clause': 'tracker:id(?playlist) = ' + self.props.pl_id
"filter_clause": 'tracker:id(?playlist) = ' + self.props.pl_id,
"location_filter": self._tracker_wrapper.location_filter()
}
def _add_to_playlist_cb(
......@@ -645,9 +647,13 @@ class Playlist(GObject.GObject):
NOT EXISTS { ?song a nmm:Video }
&& NOT EXISTS { ?song a nmm:Playlist }
)
%(location_filter)s
}
""".replace("\n", " ").strip() % {
"filter_clause": "tracker:id(?song) = " + media_id}
"filter_clause": "tracker:id(?song) = " + media_id,
"location_filter": self._tracker_wrapper.location_filter()
}
options = self._fast_options.copy()
self._source.query(
query, self.METADATA_KEYS, options, _add_to_model)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment