"search", "sticker find",]
track_obj = ['currentsong']
if self._comm in tracks_listing + track_obj:
- # pylint: disable=w0142
+ # pylint: disable=star-args
if isinstance(ans, list):
return [Track(**track) for track in ans]
elif isinstance(ans, dict):
# look for exact search w/ musicbrainz_artistid
exact_m = self._execute('list', ['artist', 'musicbrainz_artistid', artist.mbid])
if exact_m:
- [artist.add_alias(name) for name in exact_m]
+ _ = [artist.add_alias(name) for name in exact_m]
found = True
else:
artist = Artist(name=artist.name)
kwalbart = {'albumartist':name, 'artist':name}
for album in self.list('album', 'albumartist', artist):
if album and album not in albums:
- albums.append(Album(name=album, **kwalbart))
+ albums.append(Album(name=album, **kwalbart)) #pylint: disable=star-args
for album in self.list('album', 'artist', artist):
album_trks = [trk for trk in self.find('album', album)]
if 'Various Artists' in [tr.albumartist for tr in album_trks]:
self.log.warning('Disabling MusicBrainzIdentifier')
Artist.use_mbid = False
else:
- self.log.trace('Available metadata: %s', self._client.tagtypes())
+ self.log.trace('Available metadata: %s', self._client.tagtypes()) # pylint: disable=no-member
else:
self.log.warning('Use of MusicBrainzIdentifier disabled!')
self.log.info('Consider using MusicBrainzIdentifier for your music library')
def foreach_plugin(self, method, *args, **kwds):
"""Plugin's callbacks dispatcher"""
- self.log.trace('dispatching %s to plugins', method)
+ self.log.trace('dispatching %s to plugins', method) # pylint: disable=no-member
for plugin in self.core_plugins:
getattr(plugin, method)(*args, **kwds)
for plugin in self.plugins:
try:
plugin_obj = getattr(mod_obj, plugin)
except AttributeError as err:
- logger.error('Failed to load plugin {0} ({1})'.format(plugin, err))
+ logger.error('Failed to load plugin %s (%s)', plugin, err)
sima.shutdown()
sys.exit(1)
logger.info('Loading {0} plugin: {name} ({doc})'.format(
if not isinstance(artist, Artist):
raise TypeError('"{0!r}" not an Artist object'.format(artist))
if artist.mbid:
- payload.update(
- id='musicbrainz:artist:{0}'.format(artist.mbid))
+ payload.update(id='musicbrainz:artist:{0}'.format(artist.mbid))
else:
payload.update(name=artist.name)
payload.update(bucket='id:musicbrainz')
# Construct URL
ressource = '{0}/artist/similar'.format(SimaEch.root_url)
ans = self.http(ressource, payload)
- self._controls_answer(ans.json())
- for art in ans.json().get('response').get('artists'):
+ self._controls_answer(ans.json()) # pylint: disable=no-member
+ for art in ans.json().get('response').get('artists'): # pylint: disable=no-member
mbid = get_mbid(art)
yield Artist(mbid=mbid, name=art.get('name'))
# Construct URL
ressource = '{0}/song/search'.format(SimaEch.root_url)
ans = self.http(ressource, payload)
- self._controls_answer(ans.json())
+ self._controls_answer(ans.json()) # pylint: disable=no-member
titles = list()
- art = {
- 'artist': artist.name,
- 'musicbrainz_artistid': artist.mbid,
- }
- for song in ans.json().get('response').get('songs'):
+ art = {'artist': artist.name,
+ 'musicbrainz_artistid': artist.mbid,}
+ for song in ans.json().get('response').get('songs'): # pylint: disable=no-member
title = song.get('title')
if not art.get('musicbrainz_artistid'):
art['musicbrainz_artistid'] = get_mbid(song, 'artist_foreign_ids')
"""
def __init__(self, daemon):
super().__init__(daemon)
+ self.daemon = daemon
self.target = None
if not self.plugin_conf:
return
def callback_next_song(self):
if not self.target:
return
- if not self._Plugin__daemon.enabled:
+ if not self.daemon.enabled:
self.log.debug('Queueing disabled, not cropping')
return False
- player = self._Plugin__daemon.player
+ player = self.daemon.player
if player.currentsong().pos > self.target:
self.log.debug('cropping playlist')
while player.currentsong().pos > self.target: