[gnome-music/wip/jfelder/tracker-filter-audio-content-changed] grltrackerwrapper: Filter content changed to keep only songs



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

    grltrackerwrapper: Filter content changed to keep only songs
    
    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.

 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..f850ca51 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()]
 
         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]