add progstack to WPD too (fixed)

pull/96/head
Aevann 2023-01-24 12:05:16 +02:00
parent 0a42bde52b
commit 1eb0cdffac
2 changed files with 20 additions and 19 deletions

View File

@ -29,8 +29,7 @@ def sort_objects(sort, objects, cls, include_shadowbanned=False):
if sort == 'hot':
ti = int(time.time()) + 3600
if SITE_NAME == 'rDrama': metric = cls.realupvotes
else: metric = cls.upvotes - cls.downvotes
metric = cls.realupvotes
if cls.__name__ == "Submission": metric += cls.comment_count/5
return objects.order_by(-1000000*(metric + 1)/(func.power(((ti - cls.created_utc)/1000), 1.23)), cls.created_utc.desc())
elif sort == "bump" and cls.__name__ == "Submission":

View File

@ -161,11 +161,13 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
if SITE_NAME == 'rDrama':
target.realupvotes = get_vote_count(0, True) # first arg is ignored here
else:
target.realupvotes = target.upvotes - target.downvotes
mul = 1
if target.is_approved == PROGSTACK_ID:
mul = PROGSTACK_MUL
else:
elif SITE_NAME == 'rDrama':
if target.author.progressivestack or (target.author.admin_level and target.author.id not in {AEVANN_ID, CARP_ID}):
mul = 2
if cls == Submission and target.author.id not in {8768,3402,5214,12719}: