[irc] no exception when the user does not have a file

This commit is contained in:
HarHar 2013-01-24 21:20:46 -02:00
parent e4c57e6e97
commit 5a44c46e50

View File

@ -65,6 +65,8 @@ class Bot(object):
def sp_paused(self, who, room):
self.msg(self.channel, chr(2) + '<' + who + '>'+ chr(15) +' has paused (room ' + room + ')')
def sp_fileplaying(self, who, filename, room): #for when syncplay knows what filename is being played
if filename == '':
return
self.msg(self.channel, chr(2) + '<' + who + '>'+ chr(15) +' is playing "' + filename + '" (room ' + room + ')')
def sp_seek(self, who, fromTime, toTime, room):
self.msg(self.channel, chr(2) + '<' + who + '>'+ chr(15) +' has jumped from ' + utils.formatTime(fromTime) + ' to ' + utils.formatTime(toTime) +' (room ' + room + ')')
@ -122,7 +124,13 @@ class Bot(object):
paused = self.functions[5](room)
out = chr(2) + '<Paused>' + chr(15) if paused else chr(2) + '<Playing>' + chr(15)
out += ' [' + utils.formatTime(self.functions[2](room)) + '/' + utils.formatTime(users[0]['length']) + '] '
out += users[0]['file']
for u in users:
if u['file'] == None: continue
out += u['file']
break
else:
out += '[no file]'
self.msg(to, out)
out = 'Users: '
i = 0