Fix template filter for videos
This commit is contained in:
parent
35f9275456
commit
cfced13e4a
1 changed files with 6 additions and 1 deletions
|
@ -251,6 +251,11 @@ def get_attachment_url(url, size):
|
|||
|
||||
@filters.app_template_filter()
|
||||
def get_video_url(url):
|
||||
if isinstance(url, list):
|
||||
for link in url:
|
||||
if link.get("mimeType", "").startswith("video/"):
|
||||
return _get_file_url(link.get("href"), None, Kind.ATTACHMENT)
|
||||
else:
|
||||
return _get_file_url(url, None, Kind.ATTACHMENT)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue