From 1bc21588a61046583941f1cf31c36d9f59a691ad Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 16 Nov 2012 02:50:10 +0100 Subject: [PATCH] fix type of direct uploads --- pandora/archive/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 0ea3869b5..2555ede62 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -206,6 +206,14 @@ def addFile(request): i.save() f = models.File(oshash=oshash, item=i) f.path = data.get('filename', 'Untitled') + extension = f.path.split('.') + if len(extension) > 1: + extension = extension[-1] + else: + extension = 'webm' + f.path_info = { + 'extension': extension + } f.selected = True f.info = data['info'] f.save()