mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Fix template filter for videos
This commit is contained in:
parent
35f9275456
commit
cfced13e4a
1 changed files with 6 additions and 1 deletions
|
@ -251,7 +251,12 @@ def get_attachment_url(url, size):
|
|||
|
||||
@filters.app_template_filter()
|
||||
def get_video_url(url):
|
||||
return _get_file_url(url, None, Kind.ATTACHMENT)
|
||||
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)
|
||||
|
||||
|
||||
@filters.app_template_filter()
|
||||
|
|
Loading…
Reference in a new issue