[gnome-music/wip/mschraal/grltrackerwrapper-add-removal-for-songs-model-3-36] grltrackerwrapper: Handle missing change notification case



commit 91cbbc4ccadf171c474e5871e2c6ca366474b606
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat May 23 00:16:27 2020 +0200

    grltrackerwrapper: Handle missing change notification case
    
    When Grilo notifies that a media has changed, either a property of the
    media has changed or it has been moved within Trackers indexed
    locations.
    Music likely only uses part of the Tracker indexed locations and so
    some changes are additions/removals from Musics perspective. The code
    that handles this only dealt with additions mistakenly, add a case for
    removal too.

 gnomemusic/grilowrappers/grltrackerwrapper.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index ae2626a5..31d6d681 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -352,6 +352,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 return
 
             if not media:
+                self._remove_media(media_ids)
                 return
 
             if media.get_id() not in self._hash:
@@ -364,6 +365,8 @@ class GrlTrackerWrapper(GObject.GObject):
             else:
                 self._hash[media.get_id()].update(media)
 
+            media_ids.remove(media.get_id())
+
         options = self._fast_options.copy()
 
         self.props.source.query(


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