stacked changes

pull/150/head
Aevann 2023-05-15 12:27:24 +03:00
parent bee7cc8892
commit 5c4e0a5b79
7 changed files with 17 additions and 3982 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@ -351,17 +351,17 @@ class Submission(Base):
@property
@lazy
def is_video(self):
return self.url and any((self.url.lower().split('?')[0].endswith(f'.{x}') for x in VIDEO_FORMATS)) and is_safe_url(self.url)
return self.url and any((str(self.url).lower().split('?')[0].endswith(f'.{x}') for x in VIDEO_FORMATS)) and is_safe_url(self.url)
@property
@lazy
def is_audio(self):
return self.url and any((self.url.lower().split('?')[0].endswith(f'.{x}') for x in AUDIO_FORMATS)) and is_safe_url(self.url)
return self.url and any((str(self.url).lower().split('?')[0].endswith(f'.{x}') for x in AUDIO_FORMATS)) and is_safe_url(self.url)
@property
@lazy
def is_image(self):
return self.url and any((self.url.lower().split('?')[0].endswith(f'.{x}') for x in IMAGE_FORMATS)) and is_safe_url(self.url)
return self.url and any((str(self.url).lower().split('?')[0].endswith(f'.{x}') for x in IMAGE_FORMATS)) and is_safe_url(self.url)
@lazy
def filtered_flags(self, v):

View File

@ -588,6 +588,8 @@ def submit_post(v:User, sub=None):
if url and url.startswith(SITE_FULL):
url = url.split(SITE_FULL)[1]
if url == '': url = None
p = Submission(
private=flag_private,
notify=flag_notify,

View File

@ -1329,7 +1329,7 @@ def claim_rewards(v):
if transaction.amount < money: break
tier = t
marseybux += TIER_TO_MARSEYBUX[tier]
marseybux += TIER_TO_MBUX[tier]
if tier > highest_tier:
highest_tier = tier
transaction.claimed = True

View File

@ -164,7 +164,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
mul = 1
if target.is_approved == PROGSTACK_ID:
mul = PROGSTACK_MUL
elif cls == Submission and (any(i in target.title.lower() for i in ENCOURAGED) or any(i in target.url.lower() for i in ENCOURAGED2)):
elif cls == Submission and (any(i in target.title.lower() for i in ENCOURAGED) or any(i in str(target.url).lower() for i in ENCOURAGED2)):
mul = PROGSTACK_MUL
send_notification(AEVANN_ID, target.permalink)
elif target.author.progressivestack or (target.author.admin_level and target.author.id not in {CARP_ID, SCHIZO_ID}):

BIN
magick

Binary file not shown.

File diff suppressed because it is too large Load Diff