mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 13:01:07 -05:00
LastFM: more immersive nowplaying output (#95)
* Making the output for nowplaying immersive Added a simple conditional to make the output of now playing a little more aesthetically pleasing. mogad0n is listening to Roller Mobster by Carpenter Brut [Trilogy] vs mogad0n listened to Roller Mobster by Carpenter Brut [Trilogy] just now. Close #92
This commit is contained in:
parent
f548d2dd54
commit
2a098528c7
@ -113,7 +113,7 @@ class LastFM(callbacks.Plugin):
|
||||
tformat = conf.supybot.reply.format.time()
|
||||
time = "at %s" % datetime.fromtimestamp(time).strftime(tformat)
|
||||
except KeyError: # Nothing given by the API?
|
||||
time = "just now"
|
||||
time = None
|
||||
|
||||
public_url = ''
|
||||
# If the DDG plugin from this repository is loaded, we can integrate
|
||||
@ -148,8 +148,12 @@ class LastFM(callbacks.Plugin):
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
s = '%s listened to %s by %s %s %s%s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
||||
ircutils.bold(artist), album, time, ext_info, public_url)
|
||||
if time is None:
|
||||
s = '%s is listening to %s by %s %s %s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
||||
ircutils.bold(artist), album, ext_info, public_url)
|
||||
else:
|
||||
s = '%s listened to %s by %s %s %s%s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
||||
ircutils.bold(artist), album, time, ext_info, public_url)
|
||||
irc.reply(utils.str.normalizeWhitespace(s))
|
||||
|
||||
@wrap(["something"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user