[gnome-music/wip/jfelder/3-34-xdg-directory-not-set: 2/2] coregrilo: Do not query tracker if xdg music dir is not set



commit 521c9e8cda60a5ce82e70288edcf7adfb8441cc1
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Nov 8 23:17:28 2019 +0100

    coregrilo: Do not query tracker if xdg music dir is not set
    
    GrlTrackerWrapper
    
    (cherry picked from commit fc1f85ac1afde42fb5cff7c8998829ae9b564692)

 gnomemusic/coregrilo.py      | 1 +
 gnomemusic/trackerwrapper.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index 1b53d886..29805fd6 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -126,6 +126,7 @@ class CoreGrilo(GObject.GObject):
         new_state = self._tracker_wrapper.props.tracker_available
         if (source.props.source_id == "grl-tracker-source"
                 and source.props.source_id not in self._wrappers.keys()
+                and TrackerWrapper.location_filter() is not None
                 and new_state == TrackerState.AVAILABLE):
             new_wrapper = GrlTrackerWrapper(
                 source, self._coremodel, self._application, self,
diff --git a/gnomemusic/trackerwrapper.py b/gnomemusic/trackerwrapper.py
index 413c3950..922003f8 100644
--- a/gnomemusic/trackerwrapper.py
+++ b/gnomemusic/trackerwrapper.py
@@ -107,7 +107,7 @@ class TrackerWrapper(GObject.GObject):
             assert music_dir is not None
         except (TypeError, AssertionError):
             logger.warning("XDG Music dir is not set")
-            return
+            return None
 
         music_dir = Tracker.sparql_escape_string(
             GLib.filename_to_uri(music_dir))


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