Permalink
Browse files

+ in oa-put, set extension for uploaded video files to ogv and for au…

…dio files to oga
  • Loading branch information...
1 parent d047ebb commit 247e2064391758b6ff204b5fba5ba8e8fcdd9b73 @erlehmann erlehmann committed Sep 20, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 oa-put
View
7 oa-put
@@ -88,7 +88,12 @@ if action == 'upload-media':
#TODO: file extension should be adapted for other file formats
url_path = urlparse.urlsplit(material.url).path
source_filename = url_path.split('/')[-1]
- wiki_filename = path.splitext(source_filename)[0] + '.ogv'
+ assert(mimetype in ('audio', 'video'))
+ if mimetype == 'audio':
+ extension = 'oga'
+ elif mimetype == 'video':
+ extension = 'ogv'
+ wiki_filename = path.splitext(source_filename)[0] + '.' + extension
if article_title is not None:
dirty_prefix = article_title
dirty_prefix = dirty_prefix.replace('\n', '')

0 comments on commit 247e206

Please sign in to comment.