ignore text files
This commit is contained in:
parent
25513b7a12
commit
29395aeeff
3 changed files with 11 additions and 3 deletions
|
@ -5,7 +5,7 @@ from django.conf import settings
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
from ... import models
|
from ... import models, extract
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -51,6 +51,11 @@ class Command(BaseCommand):
|
||||||
for s in models.Stream.objects.filter(source=None):
|
for s in models.Stream.objects.filter(source=None):
|
||||||
if not glob("%s*"%s.timeline_prefix):
|
if not glob("%s*"%s.timeline_prefix):
|
||||||
s.make_timeline()
|
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.selected = True
|
||||||
s.file.save()
|
s.file.save()
|
||||||
s.file.item.update_timeline()
|
s.file.item.update_timeline()
|
||||||
|
|
|
@ -97,8 +97,11 @@ class File(models.Model):
|
||||||
self.is_audio = False
|
self.is_audio = False
|
||||||
if self.path.endswith('.jpg') or \
|
if self.path.endswith('.jpg') or \
|
||||||
self.path.endswith('.png') or \
|
self.path.endswith('.png') or \
|
||||||
|
self.path.endswith('.txt') or \
|
||||||
|
self.video_codec == 'ansi' or \
|
||||||
self.duration == 0.04:
|
self.duration == 0.04:
|
||||||
self.is_video = False
|
self.is_video = False
|
||||||
|
self.video_codec = ''
|
||||||
else:
|
else:
|
||||||
self.is_video = False
|
self.is_video = False
|
||||||
self.display_aspect_ratio = "4:3"
|
self.display_aspect_ratio = "4:3"
|
||||||
|
|
|
@ -184,7 +184,7 @@ def firefogg_upload(request):
|
||||||
chunk_id = form.cleaned_data['chunkId']
|
chunk_id = form.cleaned_data['chunkId']
|
||||||
response = {
|
response = {
|
||||||
'result': 1,
|
'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']):
|
if not f.save_chunk(c, chunk_id, form.cleaned_data['done']):
|
||||||
response['result'] = -1
|
response['result'] = -1
|
||||||
|
@ -210,7 +210,7 @@ def firefogg_upload(request):
|
||||||
f.save()
|
f.save()
|
||||||
response = {
|
response = {
|
||||||
'uploadUrl': request.build_absolute_uri('/api/upload/?id=%s&profile=%s' % (f.oshash, profile)),
|
'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
|
'result': 1
|
||||||
}
|
}
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
Loading…
Reference in a new issue