From fcbe552de301c121d3191525bcac7239ef306081 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 11 Apr 2014 19:34:15 +0000 Subject: [PATCH] fix stream uploads --- pandora/archive/models.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index b5dbe4ed8..feedd0a89 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -324,7 +324,14 @@ class File(models.Model): stream, created = Stream.objects.get_or_create( file=self, resolution=resolution, format=format) name = stream.path(stream.name()) - return save_chunk(stream, stream.media, chunk, offset, name) + + def done_cb(): + if done: + stream.available = True + stream.info = {} + stream.save() + return True, stream.media.size + return save_chunk(stream, stream.media, chunk, offset, name, done_cb) return False, 0 def stream_resolution(self):