Skip to content

Commit

Permalink
gmusic: Fix compatibility with gmusicapi>=12.0.0
Browse files Browse the repository at this point in the history
Fixes #3270.
  • Loading branch information
sampsyo committed May 18, 2019
1 parent d6dc1b7 commit d77a13e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion beetsplug/gmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@ class Gmusic(BeetsPlugin):
def __init__(self):
super(Gmusic, self).__init__()
self.m = Musicmanager()

# OAUTH_FILEPATH was moved in gmusicapi 12.0.0.
if hasattr(Musicmanager, 'OAUTH_FILEPATH'):
oauth_file = Musicmanager.OAUTH_FILEPATH
else:
oauth_file = gmusicapi.clients.OAUTH_FILEPATH

self.config.add({
u'auto': False,
u'uploader_id': '',
u'uploader_name': '',
u'device_id': '',
u'oauth_file': gmusicapi.clients.OAUTH_FILEPATH,
u'oauth_file': oauth_file,
})
if self.config['auto']:
self.import_stages = [self.autoupload]
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Fixes:
* :doc:`/plugins/gmusic`: The ``oauth_file`` config option now supports more
flexible path values, including ``~`` for the home directory.
:bug:`3270`
* :doc:`/plugins/gmusic`: Fix a crash when using version 12.0.0 or later of
the ``gmusicapi`` module.
:bug:`3270`


1.4.8 (May 16, 2019)
Expand Down

0 comments on commit d77a13e

Please sign in to comment.