forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-01-12 01:37:04 +02:00
parent a05aed3300
commit 88f1b02ecf
3 changed files with 10 additions and 8 deletions

View File

@ -1,9 +1,10 @@
from os import environ
from os import environ, listdir
import re
from copy import deepcopy
from json import loads
SITE = environ.get("DOMAIN", '').strip()
SITE_NAME = environ.get("SITE_NAME", '').strip()
import json
@ -765,4 +766,6 @@ NOTIFIED_USERS = {
'dong': DONGER_ID,
'dong': FARTBINN_ID,
'kippy': KIPPY_ID,
}
}
num_banners = len(listdir('files/assets/images/Drama/banners')) + 1

View File

@ -1,9 +1,7 @@
from files.__main__ import app
from .get import *
from os import listdir, environ
from files.helpers import const
num_banners = len(listdir('files/assets/images/Drama/banners')) + 1
SITE_NAME = environ.get("SITE_NAME", '').strip()
@app.template_filter("full_link")
def full_link(url):
@ -28,4 +26,5 @@ def post_embed(id, v):
@app.context_processor
def inject_constants():
return {"num_banners":num_banners, "environ":environ, "SITE_NAME":SITE_NAME}
constants = [c for c in dir(const) if not c.startswith("_")]
return {c:getattr(const, c) for c in constants}

View File

@ -16,7 +16,7 @@ site = environ.get("DOMAIN").strip()
beams_client = PushNotifications(instance_id=PUSHER_INSTANCE_ID, secret_key=PUSHER_KEY)
if True:
if site == 'rdrama.net':
topmakers = {}
for k, val in marseys.items():
if val in topmakers: topmakers[val] += 1
@ -330,7 +330,7 @@ def leaderboard(v):
for user in users11: users12.append((user, badges[user.id]))
users12 = sorted(users12, key=lambda x: x[1], reverse=True)[:25]
if True: users13 = topmakers
if request.host == 'rdrama.net': users13 = topmakers
else: users13 = None
votes1 = g.db.query(Vote.user_id, func.count(Vote.user_id)).filter(Vote.vote_type==1).group_by(Vote.user_id).order_by(func.count(Vote.user_id).desc()).all()