tweak rdrama algo

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-11-09 21:02:17 +02:00
parent 5a10b849f8
commit c8b4947fa4
2 changed files with 21 additions and 8 deletions

View File

@ -1604,6 +1604,15 @@ BOOSTED_SITES = {
'tattle.life',
}
BOOSTED_HOLES = {
'furry',
'femboy',
'anime',
'gaybros',
'againsthateholes',
'masterbaiters',
}
IMAGE_FORMATS = ['png','gif','jpg','jpeg','webp']
VIDEO_FORMATS = ['mp4','webm','mov','avi','mkv','flv','m4v','3gp']
AUDIO_FORMATS = ['mp3','wav','ogg','aac','m4a','flac']

View File

@ -141,15 +141,19 @@ 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
if target.author.progressivestack or (cls == Submission and (target.domain.endswith('.win') or target.domain in BOOSTED_SITES or len(target.body) > 5000 or target.sub == 'masterbaiters')):
target.realupvotes *= 2
elif cls == Submission and len(target.body) < 5000:
multipler = len(target.body)/5000 + 1
target.realupvotes *= multipler
if cls == Submission and target.sub and target.sub not in ('space', 'istory', 'dinos', 'furry', 'anime', 'slackernews', 'gaybros', 'againsthateholes', 'femboy', 'masterbaiters'):
target.realupvotes *= 0.7
mul = 1
if target.author.progressivestack:
mul = 2
elif cls == Submission:
if target.domain.endswith('.win') or target.domain in BOOSTED_SITES or target.sub in BOOSTED_HOLES:
mul = 2
elif target.sub:
mul = 0.7
elif len(target.body) > 2000:
mul = 1 + len(target.body)/5000
mul = min(mul, 2)
target.realupvotes *= mul
g.db.add(target)
return "", 204