Added duration to message

This commit is contained in:
Uriziel 2012-09-22 03:27:37 +02:00
parent 35a6ed650f
commit 980a5b157e

View File

@ -65,7 +65,7 @@ class SyncClientProtocol(CommandProtocol):
who, where, what, duration, size = args[0], args[1], None, None, None
self.__syncplayClient.users.addUser(SyncplayClientManager.SyncplayUser(who, what, where, duration, size))
if what:
message = '%s is present and is playing \'%s\' in the room: \'%s\'' % (who, what, where) #TODO: add duration to message
message = '%s is present and is playing \'%s\' (%s) in the room: \'%s\'' % (who, what, format_time(int(duration)), where)
self.__syncplayClient.ui.showMessage(message)
self.__syncplayClient.checkIfFileMatchesOthers()
else:
@ -108,7 +108,7 @@ class SyncClientProtocol(CommandProtocol):
@argumentCount(5)
def playing(self, args):
who, where, what, duration, size = args
message = '%s is playing \'%s\' in the room: \'%s\'' % (who, what, where) #TODO: add duration to message
message = '%s is playing \'%s\' (%s) in the room: \'%s\'' % (who, what, format_time(int(duration)), where)
self.__syncplayClient.ui.showMessage(message)
self.__syncplayClient.users.addUser(SyncplayClientManager.SyncplayUser(who, what, where, duration, size))
self.__syncplayClient.checkIfFileMatchesOthers()