From c071524cb928f5771a1f6ef64d7c7b8c28c09802 Mon Sep 17 00:00:00 2001 From: Yiannis Christodoulou Date: Sun, 19 Oct 2025 12:10:03 +0300 Subject: [PATCH] Support audio in trim video URL and path properties Expanded the media type check in trim_video_url and trim_video_path properties to include 'audio' alongside 'video', allowing these properties to handle audio media types as well. --- files/models/media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/models/media.py b/files/models/media.py index 65f1c5e9..01303875 100644 --- a/files/models/media.py +++ b/files/models/media.py @@ -630,7 +630,7 @@ class Media(models.Model): @property def trim_video_url(self): - if self.media_type not in ["video"]: + if self.media_type not in ["video", "audio"]: return None ret = self.encodings.filter(status="success", profile__extension='mp4', chunk=False).order_by("-profile__resolution").first() @@ -642,7 +642,7 @@ class Media(models.Model): @property def trim_video_path(self): - if self.media_type not in ["video"]: + if self.media_type not in ["video", "audio"]: return None ret = self.encodings.filter(status="success", profile__extension='mp4', chunk=False).order_by("-profile__resolution").first()