diff libervia_server/__init__.py @ 394:ee61b0765d6c

browser_side: radiocol supports MP3
author souliane <souliane@mailoo.org>
date Thu, 06 Mar 2014 01:06:19 +0100
parents c86d7a8d2c1e
children ee8ebfe23e16
line wrap: on
line diff
--- a/libervia_server/__init__.py	Wed Mar 05 21:42:03 2014 +0100
+++ b/libervia_server/__init__.py	Thu Mar 06 01:06:19 2014 +0100
@@ -926,7 +926,8 @@
     NAME = 'song'
 
     def _getFileName(self, request):
-        return "%s.ogg" % str(uuid.uuid4()) #XXX: chromium doesn't seem to play song without the .ogg extension, even with audio/ogg mime-type
+        extension = os.path.splitext(request.args['filename'][0])[1]
+        return "%s%s" % (str(uuid.uuid4()), extension)  # XXX: chromium doesn't seem to play song without the .ogg extension, even with audio/ogg mime-type
 
     def _fileWritten(self, request, filepath):
         """Called once the file is actually written on disk