From 86ee28d024793bdd086a4aa14829e0bb5dd7bf81 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 6 May 2023 15:18:26 +0300 Subject: [PATCH] increase postdropoff and constantize LNTERNETCUSTODIAN_ID --- files/helpers/config/const.py | 2 ++ files/helpers/sorting_and_time.py | 2 +- files/routes/votes.py | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index d7bd05f88..1899e10fb 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -659,6 +659,7 @@ TGTW_ID = 0 IDIO_ID = 0 SCHIZO_ID = 0 SNALLY_ID = 0 +LNTERNETCUSTODIAN_ID = 0 IMMUNE_TO_AWARDS = {} @@ -762,6 +763,7 @@ if SITE == 'rdrama.net': IDIO_ID = 30 SCHIZO_ID = 8494 SNALLY_ID = 3336 + LNTERNETCUSTODIAN_ID = 8768 IMMUNE_TO_AWARDS = {PIZZASHILL_ID, CARP_ID} diff --git a/files/helpers/sorting_and_time.py b/files/helpers/sorting_and_time.py index 36ac7dca7..6996dad53 100644 --- a/files/helpers/sorting_and_time.py +++ b/files/helpers/sorting_and_time.py @@ -30,7 +30,7 @@ def sort_objects(sort, objects, cls): ti = int(time.time()) + 3600 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()) + return objects.order_by(-1000000*(metric + 1)/(func.power(((ti - cls.created_utc)/1000), 1.5)), cls.created_utc.desc()) elif sort == "views" and cls.__name__ == "Submission": return objects.order_by(cls.views.desc(), cls.created_utc.desc()) elif sort == "bump" and cls.__name__ == "Submission": diff --git a/files/routes/votes.py b/files/routes/votes.py index 8ed44229c..d876d6f3a 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -169,10 +169,12 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): mul = 2 elif SITE == 'rdrama.net' and cls == Submission: if (target.domain.endswith('.win') or 'forum' in target.domain or 'chan' in target.domain - or (target.domain in BOOSTED_SITES and not target.url.startswith('/')) - or target.sub in BOOSTED_HOLES): + or (target.domain in BOOSTED_SITES and not target.url.startswith('/'))): mul = 2 - if target.body_html and target.author.id != 8768: + elif target.sub in BOOSTED_HOLES: + mul = 1.25 + + if target.body_html and target.author.id != LNTERNETCUSTODIAN_ID: x = target.body_html.count('" target="_blank" rel="nofollow noopener">') x += target.body_html.count('" rel="nofollow noopener" target="_blank">') target.realupvotes += min(x*2, 20)