From 5a44c46e509733e4c8d6833bcd1ab19ac8a26892 Mon Sep 17 00:00:00 2001 From: HarHar Date: Thu, 24 Jan 2013 21:20:46 -0200 Subject: [PATCH] [irc] no exception when the user does not have a file --- syncplay/ircBot.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/syncplay/ircBot.py b/syncplay/ircBot.py index f97e9b2..12cdb84 100644 --- a/syncplay/ircBot.py +++ b/syncplay/ircBot.py @@ -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) + '' + chr(15) if paused else chr(2) + '' + 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