Gmusic fixes based on review and changelog addition

* Fixes based on review and changelog addition
This commit is contained in:
Scott Carlson 2018-08-06 16:41:09 -05:00 committed by GitHub
parent ef4490087b
commit cfe8ed9c34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -41,7 +41,7 @@ class Gmusic(BeetsPlugin):
self.config.add({
u'auto': False,
})
if self.config['auto'].get(bool):
if self.config['auto']:
self.import_stages = [self.autoupload]
def commands(self):
@ -63,19 +63,22 @@ class Gmusic(BeetsPlugin):
def upload(self, lib, opts, args):
items = lib.items(ui.decargs(args))
files = [x.path.decode('utf-8') for x in items]
files = self.getpaths(items)
ui.print_(u'Uploading your files...')
self.m.upload(filepaths=files)
ui.print_(u'Your files were successfully added to library')
def autoupload(self, session, task):
items = task.imported_items()
files = [x.path.decode('utf-8') for x in items]
ui.print_(u'Uploading your files to Google Play Music...')
files = self.getpaths(items)
self._log.info(u'Uploading files to Google Play Music...', files)
self.m.upload(filepaths=files)
ui.print_(u'Your files were successfully added to your '
self._log.info(u'Your files were successfully added to your '
+ 'Google Play Music library')
def getpaths(self, items):
return [x.path for x in items]
def search(self, lib, opts, args):
password = config['gmusic']['password']
email = config['gmusic']['email']

View file

@ -16,6 +16,8 @@ New features:
:bug:`2944`
* Added whitespace padding to missing tracks dialog to improve readability.
:user:`jams2`
* Automatically upload to Google Play Music library on track import.
:user:`shuaiscott`
Fixes: