diff --git a/files/classes/submission.py b/files/classes/submission.py index 67f6b3439..4faf08c7b 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -1,3 +1,4 @@ +from _typeshed import Self from flask import render_template, g from sqlalchemy import * from sqlalchemy.orm import relationship, deferred @@ -365,14 +366,6 @@ class Submission(Base): if self.url: return self.url.lower().endswith('.webp') or self.url.lower().endswith('.jpg') or self.url.lower().endswith('.png') or self.url.lower().endswith('.gif') or self.url.lower().endswith('.jpeg') or self.url.lower().endswith('?maxwidth=9999') else: return False - @property - @lazy - def is_video(self) -> bool: - if self.url: - return self.url.startswith("https://i.imgur.com") and self.url.lower().endswith('.mp4') - else: - return False - @property @lazy def active_flags(self): return self.flags.count() diff --git a/files/templates/submission.html b/files/templates/submission.html index 336f59110..6f8232dd8 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -80,7 +80,7 @@ -{% if p.is_video %} +{% if p..url.lower().endswith('.mp4') %} {% endif %} @@ -109,7 +109,7 @@ -{% if p.is_video %} +{% if p..url.lower().endswith('.mp4') %} {% endif %} @@ -316,7 +316,7 @@
- {% elif not p.embed_url and not p.is_image and not p.is_video %} + {% elif not p.embed_url and not p.is_image and not p..url.lower().endswith('.mp4') %}