mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 05:21:10 -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()
|
tformat = conf.supybot.reply.format.time()
|
||||||
time = "at %s" % datetime.fromtimestamp(time).strftime(tformat)
|
time = "at %s" % datetime.fromtimestamp(time).strftime(tformat)
|
||||||
except KeyError: # Nothing given by the API?
|
except KeyError: # Nothing given by the API?
|
||||||
time = "just now"
|
time = None
|
||||||
|
|
||||||
public_url = ''
|
public_url = ''
|
||||||
# If the DDG plugin from this repository is loaded, we can integrate
|
# If the DDG plugin from this repository is loaded, we can integrate
|
||||||
@ -148,8 +148,12 @@ class LastFM(callbacks.Plugin):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
s = '%s listened to %s by %s %s %s%s. %s' % (ircutils.bold(user), ircutils.bold(track),
|
if time is None:
|
||||||
ircutils.bold(artist), album, time, ext_info, public_url)
|
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))
|
irc.reply(utils.str.normalizeWhitespace(s))
|
||||||
|
|
||||||
@wrap(["something"])
|
@wrap(["something"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user