ignore text files

This commit is contained in:
j 2012-01-02 09:20:54 +05:30
parent 25513b7a12
commit 29395aeeff
3 changed files with 11 additions and 3 deletions

View file

@ -5,7 +5,7 @@ from django.conf import settings
import os
from glob import glob
from ... import models
from ... import models, extract
class Command(BaseCommand):
@ -51,6 +51,11 @@ class Command(BaseCommand):
for s in models.Stream.objects.filter(source=None):
if not glob("%s*"%s.timeline_prefix):
s.make_timeline()
if not s.color:
s.cuts = tuple(extract.cuts(self.timeline_prefix))
s.color = tuple(extract.average_color(self.timeline_prefix))
s.save()
s.file.selected = True
s.file.save()
s.file.item.update_timeline()

View file

@ -97,8 +97,11 @@ class File(models.Model):
self.is_audio = False
if self.path.endswith('.jpg') or \
self.path.endswith('.png') or \
self.path.endswith('.txt') or \
self.video_codec == 'ansi' or \
self.duration == 0.04:
self.is_video = False
self.video_codec = ''
else:
self.is_video = False
self.display_aspect_ratio = "4:3"

View file

@ -184,7 +184,7 @@ def firefogg_upload(request):
chunk_id = form.cleaned_data['chunkId']
response = {
'result': 1,
'resultUrl': request.build_absolute_uri('/')
'resultUrl': request.build_absolute_uri('/%s'%f.item.itemId)
}
if not f.save_chunk(c, chunk_id, form.cleaned_data['done']):
response['result'] = -1
@ -210,7 +210,7 @@ def firefogg_upload(request):
f.save()
response = {
'uploadUrl': request.build_absolute_uri('/api/upload/?id=%s&profile=%s' % (f.oshash, profile)),
'url': request.build_absolute_uri('/%s/files' % f.item.itemId),
'url': request.build_absolute_uri('/%s' % f.item.itemId),
'result': 1
}
return render_to_json_response(response)