only user selected streams, update stream once chunk upload is done

This commit is contained in:
j 2013-03-24 20:57:38 +00:00
parent 2fa2e80fc4
commit 8f7a2094cd
2 changed files with 2 additions and 0 deletions

View File

@ -266,6 +266,7 @@ class File(models.Model):
f.write(chunk.read())
if done:
stream.available = True
stream.info = {}
stream.save()
return True
return False

View File

@ -867,6 +867,7 @@ def video(request, id, resolution, format, index=None):
#if streams.count() != 1:
# reise Http404
streams = Stream.objects.filter(file__item__itemId=item.itemId,
file__selected=True,
resolution=resolution, format=format).order_by('file__part', 'file__sort_path')
if index + 1 > streams.count():
raise Http404