[gnome-music/wip/jfelder/grilo-theaudiodb: 2/3] grilo: Add theaudiodb support
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/grilo-theaudiodb: 2/3] grilo: Add theaudiodb support
- Date: Wed, 12 Sep 2018 11:55:54 +0000 (UTC)
commit a08d27211023df0e8d07c2be5e009068791f519b
Author: Jean Felder <jfelder src gnome org>
Date: Sun Sep 2 11:57:42 2018 +0200
grilo: Add theaudiodb support
theaudiodb-cover is a grilo plugin to download cover art from the
artist and album name keys.
Add an api key to be able to use it.
Set its rank to 1.
gnomemusic/grilo.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index c989e2d5..890918be 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -35,7 +35,8 @@ import os
os.environ['GRL_PLUGIN_RANKS'] = ("grl-local-metadata:5,"
"grl-filesystem:4,"
"grl-tracker-source:3,"
- "grl-lastfm-cover:2")
+ "grl-lastfm-cover:2,"
+ "grl-theaudiodb-cover:1")
from gi.repository import Grl
logger = logging.getLogger(__name__)
@@ -76,6 +77,8 @@ class Grilo(GObject.GObject):
CHANGED_MEDIA_MAX_ITEMS = 500
CHANGED_MEDIA_SIGNAL_TIMEOUT = 2000
+ _theaudiodb_api_key = "195003"
+
sources = GObject.Property()
def __repr__(self):
@@ -122,6 +125,10 @@ class Grilo(GObject.GObject):
@log
def _find_sources(self):
+ config = Grl.Config.new('grl-lua-factory', 'grl-theaudiodb-cover')
+ config.set_api_key(self._theaudiodb_api_key)
+ self.registry.add_config(config)
+
self.registry.connect('source_added', self._on_source_added)
self.registry.connect('source_removed', self._on_source_removed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]