forked from 0x2620/pandora
use refresh_from_db
This commit is contained in:
parent
794b28f833
commit
9596248dc4
2 changed files with 5 additions and 7 deletions
|
@ -756,9 +756,8 @@ class Stream(models.Model):
|
|||
ok, error = extract.stream(media, target, self.name(), info, flags=self.flags)
|
||||
# file could have been moved while encoding
|
||||
# get current version from db and update
|
||||
_self = Stream.objects.get(id=self.id)
|
||||
_self.update_status(ok, error)
|
||||
return _self
|
||||
self.refresh_from_db()
|
||||
self.update_status(ok, error)
|
||||
|
||||
def get_index(self):
|
||||
index = 1
|
||||
|
|
|
@ -128,7 +128,7 @@ def process_stream(fileId):
|
|||
stream = streams[0]
|
||||
stream.make_timeline()
|
||||
stream.extract_derivatives()
|
||||
file = models.File.objects.get(id=fileId)
|
||||
file.refresh_from_db()
|
||||
file.encoding = False
|
||||
file.save()
|
||||
file.item.update_selected()
|
||||
|
@ -158,13 +158,12 @@ def extract_stream(fileId):
|
|||
if created:
|
||||
file.extract_frames()
|
||||
stream.media.name = stream.path(stream.name())
|
||||
stream = stream.encode()
|
||||
stream.encode()
|
||||
if stream.available:
|
||||
stream.make_timeline()
|
||||
stream.extract_derivatives()
|
||||
file.extract_tracks()
|
||||
# get current version from db
|
||||
file = models.File.objects.get(id=fileId)
|
||||
file.refresh_from_db()
|
||||
if not file.item.rendered \
|
||||
and not file.item.files.exclude(id=fileId).filter(Q(queued=True) | Q(encoding=True)).count():
|
||||
file.item.update_timeline()
|
||||
|
|
Loading…
Reference in a new issue