Skip to content

Commit

Permalink
Added time info to queue() in hanyuu_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimsonVoid committed Jan 20, 2013
1 parent a991955 commit 56c207e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hanyuu_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ def queue(server, nick, channel, text, hostmask):
else:
queue = list(manager.Queue())
if (len(queue) > 0):
message = u"{c3}Queue:{c} ".format(**irc_colours) + \
queue_time = 0
for song in manager.Queue().iter(None):
if (song.type == manager.REQUEST or song.type == manager.REGULAR):
queue_time += song.length

message = u"{c3}Queue ({total_time}):{c} ".format(total_time=timedelta(seconds=queue_time), **irc_colours) + \
" {c3}|{c} ".format(**irc_colours)\
.join([song.metadata for song in queue])
else:
Expand Down

0 comments on commit 56c207e

Please sign in to comment.