From 143834dcbda0849e3cdbdeb3d7cbeb4b705ab907 Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Thu, 15 May 2025 22:48:07 +0300 Subject: [PATCH] ref --- files/models.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/files/models.py b/files/models.py index 3dbe60e8..bc59fa34 100644 --- a/files/models.py +++ b/files/models.py @@ -1222,17 +1222,17 @@ class Encoding(models.Model): super(Encoding, self).save(*args, **kwargs) - def update_size_without_save(self): - """Update the size of an encoding without saving to avoid calling signals""" - if self.media_file: - cmd = ["stat", "-c", "%s", self.media_file.path] - stdout = helpers.run_command(cmd).get("out") - if stdout: - size = int(stdout.strip()) - size = helpers.show_file_size(size) - Encoding.objects.filter(pk=self.pk).update(size=size) - return True - return False + def update_size_without_save(self): + """Update the size of an encoding without saving to avoid calling signals""" + if self.media_file: + cmd = ["stat", "-c", "%s", self.media_file.path] + stdout = helpers.run_command(cmd).get("out") + if stdout: + size = int(stdout.strip()) + size = helpers.show_file_size(size) + Encoding.objects.filter(pk=self.pk).update(size=size) + return True + return False def set_progress(self, progress, commit=True): if isinstance(progress, int):