add progstack awawrd to WPD

master
Aevann 2023-01-25 12:57:50 +02:00
parent 369562d6ac
commit 1496b12e8f
2 changed files with 12 additions and 13 deletions

View File

@ -537,7 +537,7 @@ AWARDS = {
"deflectable": True,
"cosmetic": False,
"ghost": False,
"enabled": SITE_NAME == 'rDrama',
"enabled": True,
},
"pizzashill": {
"kind": "pizzashill",

View File

@ -167,19 +167,18 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
mul = 1
if target.is_approved == PROGSTACK_ID:
mul = PROGSTACK_MUL
elif SITE_NAME == 'rDrama':
if target.author.progressivestack or (target.author.admin_level and target.author.id not in {AEVANN_ID, CARP_ID}):
elif target.author.progressivestack or (target.author.admin_level and target.author.id not in {AEVANN_ID, CARP_ID}):
mul = 2
elif SITE == 'rdrama.net' and cls == Submission and target.author.id not in {8768,3402,5214,12719}:
if (target.domain.endswith('.win') or 'forum' in target.domain
or (target.domain in BOOSTED_SITES and not target.url.startswith('/'))
or target.sub in BOOSTED_HOLES):
mul = 2
if cls == Submission and target.author.id not in {8768,3402,5214,12719}:
if (target.domain.endswith('.win') or 'forum' in target.domain
or (target.domain in BOOSTED_SITES and not target.url.startswith('/'))
or target.sub in BOOSTED_HOLES):
mul = 2
elif not target.sub and target.body_html:
x = target.body_html.count('" target="_blank" rel="nofollow noopener">')
x += target.body_html.count('<a href="/images/')
target.realupvotes += min(x*2, 20)
mul = 1 + x/10
elif not target.sub and target.body_html:
x = target.body_html.count('" target="_blank" rel="nofollow noopener">')
x += target.body_html.count('<a href="/images/')
target.realupvotes += min(x*2, 20)
mul = 1 + x/10
mul = min(mul, 2)
target.realupvotes = floor(target.realupvotes * mul)