mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-08 16:38:54 -05:00
ref
This commit is contained in:
parent
ce2d744aca
commit
b06050e2df
@ -639,9 +639,8 @@ class Media(models.Model):
|
||||
self.preview_file_path = ""
|
||||
else:
|
||||
self.preview_file_path = encoding.media_file.path
|
||||
self.save(update_fields=["listable", "preview_file_path"])
|
||||
|
||||
self.save(update_fields=["encoding_status", "listable"])
|
||||
self.save(update_fields=["encoding_status", "listable", "listable", "preview_file_path"])
|
||||
|
||||
if encoding and encoding.status == "success" and encoding.profile.codec == "h264" and action == "add" and not encoding.chunk:
|
||||
from . import tasks
|
||||
@ -1237,7 +1236,9 @@ class Encoding(models.Model):
|
||||
if isinstance(progress, int):
|
||||
if 0 <= progress <= 100:
|
||||
self.progress = progress
|
||||
self.save(update_fields=["progress"])
|
||||
# save object with filter update
|
||||
# to avoid calling signals
|
||||
Encoding.objects.filter(pk=self.pk).update(progress=progress)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@ -466,10 +466,8 @@ def create_hls(friendly_token):
|
||||
pp = os.path.join(output_dir, "master.m3u8")
|
||||
if os.path.exists(pp):
|
||||
if media.hls_file != pp:
|
||||
media.hls_file = pp
|
||||
media.save(update_fields=["hls_file"])
|
||||
hlsfile = Media.objects.filter(friendly_token=friendly_token).first().hls_file
|
||||
# print file and size
|
||||
Media.objects.filter(pk=media.pk).update(hls_file=pp)
|
||||
hlsfile = Media.objects.filter(pk=media.pk).first().hls_file
|
||||
logger.info(f"HLS file created: {hlsfile} size {os.path.getsize(hlsfile)}")
|
||||
return True
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user