mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
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.
This commit is contained in:
parent
c21317dbb4
commit
c071524cb9
@ -630,7 +630,7 @@ class Media(models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def trim_video_url(self):
|
def trim_video_url(self):
|
||||||
if self.media_type not in ["video"]:
|
if self.media_type not in ["video", "audio"]:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
ret = self.encodings.filter(status="success", profile__extension='mp4', chunk=False).order_by("-profile__resolution").first()
|
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
|
@property
|
||||||
def trim_video_path(self):
|
def trim_video_path(self):
|
||||||
if self.media_type not in ["video"]:
|
if self.media_type not in ["video", "audio"]:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
ret = self.encodings.filter(status="success", profile__extension='mp4', chunk=False).order_by("-profile__resolution").first()
|
ret = self.encodings.filter(status="success", profile__extension='mp4', chunk=False).order_by("-profile__resolution").first()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user