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



commit 251cde2411371543a789ca4116fcdd8de2a523f2
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 385804ae..e8393075 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -341,6 +341,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 return
 
             if not media:
+                self._remove_media(media_ids)
                 return
 
             if media.get_id() not in self._hash:
@@ -351,6 +352,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]