[gnome-music/wip/carlosg/tracker3: 2/39] coregrilo: Specify the private store path to the Grilo plugin




commit 8564c34c6ecde7c42df4b19f960c65bec8f5eb0f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun May 31 17:42:43 2020 +0200

    coregrilo: Specify the private store path to the Grilo plugin
    
    This will make it possible to query for things that are in the
    private store, in addition to things from the miner-fs service.

 gnomemusic/coregrilo.py      | 5 +++++
 gnomemusic/trackerwrapper.py | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index cf58894d..cf5ef453 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -86,6 +86,11 @@ class CoreGrilo(GObject.GObject):
         config.set_api_key(self._theaudiodb_api_key)
         self._registry.add_config(config)
 
+        config = Grl.Config.new("grl-tracker3", "grl-tracker3-source")
+        config.set_string(
+            "store-path", self._tracker_wrapper.cache_directory())
+        self._registry.add_config(config)
+
         self._registry.connect('source-added', self._on_source_added)
         self._registry.connect('source-removed', self._on_source_removed)
 
diff --git a/gnomemusic/trackerwrapper.py b/gnomemusic/trackerwrapper.py
index a7bc43a3..98ef87e9 100644
--- a/gnomemusic/trackerwrapper.py
+++ b/gnomemusic/trackerwrapper.py
@@ -50,7 +50,7 @@ class TrackerWrapper(GObject.GObject):
         try:
             self._tracker = Tracker.SparqlConnection.new(
                 Tracker.SparqlConnectionFlags.NONE,
-                Gio.File.new_for_path(self._cache_directory()),
+                Gio.File.new_for_path(self.cache_directory()),
                 Tracker.sparql_get_ontology_nepomuk(),
                 None)
         except GLib.Error as error:
@@ -81,7 +81,7 @@ class TrackerWrapper(GObject.GObject):
 
         self.notify("tracker-available")
 
-    def _cache_directory(self):
+    def cache_directory(self):
         """Get directory which contains Music private data.
 
         :returns: private store path


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