[gnome-music/wip/jfelder/tracker-filter-audio-content-changed] grltrackerwrapper: Keep only songs and containers on content changes



commit 7a0f1d23a76de516db6b8d512883e1ee6667ffa1
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Dec 18 15:58:30 2019 +0100

    grltrackerwrapper: Keep only songs and containers on content changes
    
    content-changes signal is very verbose:
    - it can return multiple notifications for the same resource (one
    notification per rdf:type). For example, a song update will trigger
    two notifications with the same media id: one associated with
    nfo:Audio rdf:type and one with nmm:MusicPiece.
    - with the current design of the grilo plugin, it's not possible to
    filter the media type (one get notifications for audio, image, and
    video).
    
    Both of these changes can be filtered by discarding Grl.Media which
    are not audio. Indeed, nfo:Audio changes are not registered as a media
    audio.
    If the media is a container, it only needs to be kept, because if can
    be a specific album or artist change.

 gnomemusic/grilowrappers/grltrackerwrapper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index f8869659..debe4d21 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -126,7 +126,7 @@ class GrlTrackerWrapper(GObject.GObject):
             self._batch_changed_media_ids[change_type] = []
 
         [self._batch_changed_media_ids[change_type].append(media.get_id())
-            for media in medias]
+         for media in medias if media.is_audio() or media.is_container()]
 
         if self._content_changed_timeout is None:
             self._content_changed_timeout = GLib.timeout_add(


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