mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 04:51:08 -05:00
LastFM: handle the case where a song has no tags
This commit is contained in:
parent
7e959b9f24
commit
4cf64095ff
@ -143,10 +143,13 @@ class LastFM(callbacks.Plugin):
|
||||
|
||||
# We currently show play count and tags - more could be added in the future...
|
||||
userplaycount = ext_data['userplaycount']
|
||||
tags = [tag['name'] for tag in ext_data['toptags']['tag']]
|
||||
if ext_data['toptags']:
|
||||
tags = [tag['name'] for tag in ext_data['toptags']['tag']]
|
||||
else:
|
||||
tags = []
|
||||
ext_info = ' (Playcount: %s / Tags: %s)' % (userplaycount, ', '.join(tags) or 'N/A')
|
||||
except KeyError:
|
||||
pass
|
||||
except KeyError as e:
|
||||
log.debug("LastFM: error getting extended info", exc_info=True)
|
||||
|
||||
if time is None:
|
||||
s = '%s is listening to %s by %s %s %s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
||||
|
Loading…
x
Reference in New Issue
Block a user