]> git.parisson.com Git - timeside.git/commitdiff
Server: remove streaming capabilities for transcoded media
authorThomas Fillon <thomas@parisson.com>
Mon, 15 Dec 2014 14:05:44 +0000 (15:05 +0100)
committerThomas Fillon <thomas@parisson.com>
Mon, 15 Dec 2014 16:38:09 +0000 (17:38 +0100)
timeside/server/utils.py
timeside/server/views.py

index d09f73bbeaac5b0606d1bf3a72582a99dbd95236..ab911c4a742fde894bb50265eec0c3384a6533dc 100644 (file)
@@ -7,4 +7,3 @@ TS_ENCODERS = timeside.core.processors(IEncoder)
 TS_ENCODERS_EXT = {encoder.file_extension(): encoder.id()
                    for encoder in TS_ENCODERS
                    if encoder.file_extension()}
-
index 624bfd6b59eaab4a183d58a1594082e0760d6a28..f39bc7d632302990306c89df7e55f6977af48ece 100644 (file)
@@ -183,8 +183,8 @@ class ItemExport(DetailView):
                 result.delete()
                 return self.get(request, pk, extension)
             # Result and file exist --> OK
-            return HttpResponse(stream_from_file(result.file.path),
-                                content_type=result.mime_type)
+            return StreamingHttpResponse(stream_from_file(result.file.path),
+                                         content_type=result.mime_type)
         except Result.DoesNotExist:
             # Result does not exist
             # the corresponding task has to be created and run
@@ -211,10 +211,10 @@ class ItemExport(DetailView):
                 selection.items.add(item)
             task, created = Task.objects.get_or_create(experience=experience,
                                                        selection=selection)
-            task.save()
-
-            # Run task in streaming mode
-            response = StreamingHttpResponse()
-            response['streaming_content'] = task.run(streaming=True)
-            response['content-type'] = mime_type
-            return response
+            task.run()
+            #  TODO Run task in streaming mode
+            #response = StreamingHttpResponse(streaming_
+            #response = StreamingHttpResponse(streaming_content=stream_from_task(task),
+            #                                 content_type=mime_type)
+            # return response
+            return self.get(request, pk, extension)