fix get_sequences
This commit is contained in:
parent
be717933e4
commit
d7a96c72a1
2 changed files with 5 additions and 4 deletions
|
@ -26,7 +26,7 @@ class Sequence(models.Model):
|
|||
sort = models.ForeignKey(ItemSort, null=True, related_name='sequences')
|
||||
|
||||
hash = models.BigIntegerField(db_index=True, default=-9223372036854775808)
|
||||
start = models.FloatField(default=-1, db_index=True)
|
||||
start = models.FloatField(default=-1)
|
||||
end = models.FloatField(default=-1)
|
||||
duration = models.FloatField(default=0)
|
||||
|
||||
|
|
|
@ -4,12 +4,13 @@ from django.db import connection, transaction
|
|||
from celery.task import task
|
||||
|
||||
import models
|
||||
import item.models
|
||||
import extract
|
||||
|
||||
@task(ignore_results=True, queue='encoding')
|
||||
def get_sequences(itemId):
|
||||
i = models.Item.objects.get(itemId=itemId)
|
||||
models.Sequence.objects.filter(item=i).delete()
|
||||
i = item.models.Item.objects.get(itemId=itemId)
|
||||
models.Sequence.objects.filter(sort=i.sort).delete()
|
||||
position = 0
|
||||
for stream in i.streams():
|
||||
data, position = extract.get_sequences(stream.timeline_prefix, position)
|
||||
|
@ -19,7 +20,7 @@ def get_sequences(itemId):
|
|||
for s in data[mode]:
|
||||
sequence = {
|
||||
'sort_id': i.sort.pk,
|
||||
'mode': mode,
|
||||
'mode': models.Sequence.MODE[mode],
|
||||
'start': float('%0.03f' % s['in']),
|
||||
'end': float('%0.03f' % s['out']),
|
||||
'hash': models.parse_hash(s['hash'])
|
||||
|
|
Loading…
Reference in a new issue