mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 13:01:07 -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...
|
# We currently show play count and tags - more could be added in the future...
|
||||||
userplaycount = ext_data['userplaycount']
|
userplaycount = ext_data['userplaycount']
|
||||||
|
if ext_data['toptags']:
|
||||||
tags = [tag['name'] for tag in ext_data['toptags']['tag']]
|
tags = [tag['name'] for tag in ext_data['toptags']['tag']]
|
||||||
|
else:
|
||||||
|
tags = []
|
||||||
ext_info = ' (Playcount: %s / Tags: %s)' % (userplaycount, ', '.join(tags) or 'N/A')
|
ext_info = ' (Playcount: %s / Tags: %s)' % (userplaycount, ', '.join(tags) or 'N/A')
|
||||||
except KeyError:
|
except KeyError as e:
|
||||||
pass
|
log.debug("LastFM: error getting extended info", exc_info=True)
|
||||||
|
|
||||||
if time is None:
|
if time is None:
|
||||||
s = '%s is listening to %s by %s %s %s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
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