From ea36c5a8256bc43a0627014ade8535630188ebba Mon Sep 17 00:00:00 2001 From: Josh Brown Date: Sat, 6 Feb 2016 00:41:59 -0600 Subject: [PATCH] Allow default lastfm key to be overridden in config --- beetsplug/lastimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/lastimport.py b/beetsplug/lastimport.py index 1151622ba..29560b7f2 100644 --- a/beetsplug/lastimport.py +++ b/beetsplug/lastimport.py @@ -32,7 +32,7 @@ class LastImportPlugin(plugins.BeetsPlugin): super(LastImportPlugin, self).__init__() config['lastfm'].add({ 'user': '', - 'api_key': '', + 'api_key': plugins.LASTFM_KEY, }) config['lastfm']['api_key'].redact = True self.config.add({ @@ -171,7 +171,7 @@ def fetch_tracks(user, page, limit): } ] """ - network = pylast.LastFMNetwork(api_key=plugins.LASTFM_KEY) + network = pylast.LastFMNetwork(api_key=config['lastfm']['api_key']) user_obj = CustomUser(user, network) results, total_pages =\ user_obj.get_top_tracks_by_page(limit=limit, page=page)