matches. load subtitle annotations into database

This commit is contained in:
j 2011-06-01 18:40:39 +02:00
commit 76fcb1b61e
4 changed files with 32 additions and 18 deletions

View file

@ -89,15 +89,3 @@ def update_files(user, volume, files):
#FIXME: can this have any bad consequences? i.e. on the selction of used item files.
models.Instance.objects.filter(volume=volume).exclude(file__oshash__in=all_files).delete()
def import_subtitles(id):
f = models.File.objects.get(pk=id)
layer = models.Layer.objects.get(name='subtitles')
for data in f.srt():
annotation = models.Annotation(
item=f.item,
layer=layer,
start=data['in'],
end=data['out'],
value=data['value']
)
annotation.save()