inline is_image

master
justcool393 2022-10-28 20:52:19 -05:00
parent 6b0fe97a85
commit 61cc1ddcb7
1 changed files with 1 additions and 3 deletions

View File

@ -398,9 +398,7 @@ class Submission(Base):
@property
@lazy
def is_image(self):
if self.url and (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') or self.url.lower().endswith('&fidelity=high')) and is_safe_url(self.url):
return True
return False
return self.url and any((self.url.lower().endswith(x) for x in ('.webp','.jpg','.png','.gif','.jpeg','?maxwidth=9999','&fidelity=high'))) and is_safe_url(self.url)
@lazy
def filtered_flags(self, v):