]> git.parisson.com Git - timeside.git/commitdiff
split new mimetype dict (private / public)
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Mar 2015 15:11:48 +0000 (16:11 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Mar 2015 15:12:14 +0000 (16:12 +0100)
timeside/server/models.py

index 034909557c5abec5e5f04fea5f45453fd63ed0a8..d8ced2cc91a09d649d52b7b86cb666674c08089d 100644 (file)
@@ -50,21 +50,28 @@ PROCESSOR_PIDS = [(name, [(processor.id(), processor.id())
                           in timeside.core.processor.processors(proc_type)])
                   for name, proc_type in _processor_types.items()]
 
-extra_types = {
+public_extra_types = {
     '.webm': 'video/webm',
+}
+
+encoders = timeside.core.processor.processors(timeside.core.api.IEncoder)
+for encoder in encoders:
+    public_extra_types['.' + encoder.file_extension()] = encoder.mime_type()
+
+private_extra_types = {
     '.eaf': 'text/xml',  # ELAN Annotation Format
     '.trs':  'text/xml', # Trancriber Annotation Format
     '.svl':  'text/xml',  # Sonic Visualiser layer file
     '.TextGrid': 'text/praat-textgrid',  # Praat TextGrid annotation file
 }
 
-encoders = timeside.core.processor.processors(timeside.core.api.IEncoder)
-for encoder in encoders:
-    extra_types['.' + encoder.file_extension()] = encoder.mime_type()
+for ext,mime_type in public_extra_types.items():
+    mimetypes.add_type(mime_type, ext)
 
-for ext,mime_type in extra_types.items():
+for ext,mime_type in private_extra_types.items():
     mimetypes.add_type(mime_type, ext)
 
+
 # Status
 _FAILED, _DRAFT, _PENDING, _RUNNING, _DONE = 0, 1, 2, 3, 4
 STATUS = ((_FAILED, _('failed')), (_DRAFT, _('draft')),