matches. load subtitle annotations into database
This commit is contained in:
parent
6406a6506c
commit
76fcb1b61e
4 changed files with 32 additions and 18 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue