[gnome-music/wip/mschraal/tracker-detection: 16/18] coregrilo: Listen to tracker-available signal
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/tracker-detection: 16/18] coregrilo: Listen to tracker-available signal
- Date: Sat, 27 Jul 2019 10:41:16 +0000 (UTC)
commit 8315533f0102ee5fd1a90fa47865be61758260af
Author: Marinus Schraal <mschraal gnome org>
Date: Tue Jul 23 22:30:46 2019 +0200
coregrilo: Listen to tracker-available signal
gnomemusic/coregrilo.py | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index 5a174517..a3e2cf6e 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -62,6 +62,8 @@ class CoreGrilo(GObject.GObject):
self._wrappers = {}
self._tracker_wrapper = TrackerWrapper()
+ self._tracker_wrapper.connect(
+ "notify::tracker-available", self._on_tracker_available_changed)
Grl.init(None)
@@ -75,6 +77,13 @@ class CoreGrilo(GObject.GObject):
self._registry.load_all_plugins(True)
+ def _on_tracker_available_changed(self, klass, value):
+ # FIXME:No removal support yet.
+ if self._tracker_wrapper.props.tracker_available:
+ # FIXME: Look for a better way to just activate the Tracker
+ # plugin.
+ self._registry.load_all_plugins(True)
+
def _on_source_added(self, registry, source):
def _trigger_art_update():
@@ -116,6 +125,7 @@ class CoreGrilo(GObject.GObject):
# self._wrappers.append(new_wrapper)
print("wrapper", new_wrapper)
elif (source.props.source_id not in self._search_wrappers.keys()
+ and source.props.source_id not in self._wrappers.keys()
and source.get_supported_media() & Grl.MediaType.AUDIO
and source.supported_operations() & Grl.SupportedOps.SEARCH):
self._search_wrappers[source.props.source_id] = GrlSearchWrapper(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]