comparison libervia.tac @ 129:dd0d39ae7d24

RadioCol: song preloading + fonctionnal players
author Goffi <goffi@goffi.org>
date Sun, 29 Jan 2012 00:15:04 +0100
parents 2849ec993d89
children 6576c5a90060
comparison
equal deleted inserted replaced
128:2849ec993d89 129:dd0d39ae7d24
638 Render method with some hacks: 638 Render method with some hacks:
639 - if login is requested, try to login with form data 639 - if login is requested, try to login with form data
640 - except login, every method is jsonrpc 640 - except login, every method is jsonrpc
641 - user doesn't need to be authentified for isRegistered, but must be for all other methods 641 - user doesn't need to be authentified for isRegistered, but must be for all other methods
642 """ 642 """
643 filename = str(uuid.uuid4()) 643 filename = "%s.ogg" % str(uuid.uuid4()) #XXX: chromium doesn't seem to play song without the .ogg extension, even with audio/ogg mime-type
644 filepath = os.path.join(self.upload_dir, filename) 644 filepath = os.path.join(self.upload_dir, filename)
645 with open(filepath,'w') as f: 645 with open(filepath,'w') as f:
646 f.write(request.args['song'][0]) 646 f.write(request.args['song'][0])
647 profile = ISATSession(request.getSession()).profile 647 profile = ISATSession(request.getSession()).profile
648 self.sat_host.bridge.radiocolSongAdded(request.args['referee'][0], filepath, profile) 648 self.sat_host.bridge.radiocolSongAdded(request.args['referee'][0], filepath, profile)