diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index c9e4f3c18..a9b708619 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -68,9 +68,9 @@ class DiscogsPlugin(BeetsPlugin): c_key = self.config['apikey'].as_str() c_secret = self.config['apisecret'].as_str() + # Try using a configured user token (bypassing OAuth login). user_token = self.config['user_token'].as_str() - - if user_token is not None and user_token != '': + if user_token: self.discogs_client = Client(USER_AGENT, user_token=user_token) return diff --git a/docs/plugins/discogs.rst b/docs/plugins/discogs.rst index 56413eed6..a02b34590 100644 --- a/docs/plugins/discogs.rst +++ b/docs/plugins/discogs.rst @@ -24,15 +24,19 @@ MusicBrainz. If you have a Discogs ID for an album you want to tag, you can also enter it at the "enter Id" prompt in the importer. -OAuth authorization +OAuth Authorization ``````````````````` + The first time you run the :ref:`import-cmd` command after enabling the plugin, it will ask you to authorize with Discogs by visiting the site in a browser. Subsequent runs will not require re-authorization. -Authentication via personal access token +Authentication via Personal Access Token ```````````````````````````````````````` -To get a personal access token (called a user token in the `discogs-client`_ + +As an alternative to OAuth, you can get a token from Discogs and add it to +your configuration. +To get a personal access token (called a "user token" in the `discogs-client`_ documentation), login to `Discogs`_, and visit the `Developer settings page `_. Press the ``Generate new