From 88ca58e1de925085bf23f0d20d623d0073cd63d7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 1 Oct 2021 08:34:09 +0200 Subject: [PATCH] dfsfsd --- files/classes/submission.py | 9 +-------- files/templates/submission.html | 10 +++++----- files/templates/submission_listing.html | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) 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') %}
 								
 									
{{p.domain|truncate(30, True)}} @@ -335,7 +335,7 @@

-							{% elif p.is_video %}
+							{% elif p..url.lower().endswith('.mp4') %}
 								
- {% if not p.is_image and not p.is_video %} + {% if not p.is_image and not p..url.lower().endswith('.mp4') %}
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 9452c6e99..5bee946bf 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -102,7 +102,7 @@ - {% elif p.is_video or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %} + {% elif p..url.lower().endswith('.mp4') or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %} @@ -443,7 +443,7 @@
{% endif %} - {% if p.is_video %} + {% if p..url.lower().endswith('.mp4') %}