diff --git a/files/helpers/const.py b/files/helpers/const.py index 0a9295eb4..cc66473d2 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -156,6 +156,8 @@ AGENDAPOSTER_MSG_HTML = """

Hi here.

""" +DISCORD_CHANGELOG_CHANNEL_IDS = [924485611715452940, 1013992002624426015] +WPD_CHANNEL_ID = 1013990963846332456 ################################################################################ ### SITE SPECIFIC CONSTANTS diff --git a/files/helpers/discord.py b/files/helpers/discord.py index dd72bb077..7fe8ce844 100644 --- a/files/helpers/discord.py +++ b/files/helpers/discord.py @@ -46,9 +46,9 @@ def set_nick(user, nick): def send_changelog_message(message): data={"content": message} - requests.post("https://discordapp.com/api/channels/924485611715452940/messages", headers=headers, data=data, timeout=5) - requests.post("https://discordapp.com/api/channels/1013992002624426015/messages", headers=headers, data=data, timeout=5) + for id in DISCORD_CHANGELOG_CHANNEL_IDS: + requests.post(f"https://discordapp.com/api/channels/{id}/messages", headers=headers, data=data, timeout=5) def send_wpd_message(message): data={"content": message} - requests.post("https://discordapp.com/api/channels/1013990963846332456/messages", headers=headers, data=data, timeout=5) + requests.post(f"https://discordapp.com/api/channels/{WPD_CHANNEL_ID}/messages", headers=headers, data=data, timeout=5) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 5a5e1d9dc..be768eef3 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -52,9 +52,6 @@ def get_logged_in_user(): loggedin = cache.get(f'{SITE}_loggedin') or {} loggedout = cache.get(f'{SITE}_loggedout') or {} - g.loggedin_counter = 0 - g.loggedout_counter = 0 - timestamp = int(time.time()) if v: if session["session_id"] in loggedout: del loggedout[session["session_id"]] @@ -69,12 +66,14 @@ def get_logged_in_user(): if 'spider' not in ua.lower() and 'bot' not in ua.lower(): loggedout[session["session_id"]] = (timestamp, ua) - g.loggedin_counter = len([x for x in loggedin.values() if timestamp-x < LOGGEDIN_ACTIVE_TIME]) + loggedin = {k: v for k, v in loggedin.items() if (timestamp - v) < LOGGEDIN_ACTIVE_TIME} + loggedout = {k: v for k, v in loggedout.items() if (timestamp - v[0]) < LOGGEDIN_ACTIVE_TIME} cache.set(f'{SITE}_loggedin', loggedin) - - g.loggedout_counter = len([x for x in loggedout.values() if timestamp-x[0] < LOGGEDIN_ACTIVE_TIME]) cache.set(f'{SITE}_loggedout', loggedout) + g.loggedin_counter = len(loggedin) + g.loggedout_counter = len(loggedout) + g.v = v if v: v.poor = session.get('poor') diff --git a/files/templates/sidebar_rDrama.html b/files/templates/sidebar_rDrama.html index eedcf2197..534da3e36 100644 --- a/files/templates/sidebar_rDrama.html +++ b/files/templates/sidebar_rDrama.html @@ -13,8 +13,8 @@ sidebar image {% elif not (sub and sub.name == 'chudrama' and v.truecoins < 5000) %} - - sidebar image + + sidebar image {% endif %} {% endif %} diff --git a/seed-db.sql b/seed-db.sql index ee2806e5e..2927c7ef6 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1254,6 +1254,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES ('marseyben10',2,'ten anime cartoon lawlz',NULL), ('marseybestfriends',2,'snoo reddit alien slice kill kys stab blood wpd',NULL), ('marseybetauprising',2,'blackops2cel blops2cel incel volcel lasereyes dark involuntary celibate saint',1663213986), +('marseybiast',2,'darrell brooks court biased biast',1665784922), ('marseybiden',2,'ddd dementia daddy president sleepy joe',NULL), ('marseybiden2',2,'biden ddd dementia daddy president sleepy joe gas petrol ididthat',NULL), ('marseybigbrain',2,'high iq highiq smart genius brain',NULL), @@ -1945,6 +1946,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES ('marseyjumpscare',2,'undead living dead romero halloween horror corpse scary rotten animated spooky aaaahhhhh trick prank bait and switch',NULL), ('marseyjunkie',2,'needles heroin reaction shooting up addicted shoot up syringe',NULL), ('marseyjunkie2',2,'addicted drugs pills glue huffing ether overdose',NULL), +('marseyjurisdiction',2,'darrell brooks court subject matter jurisdiction',1665785047), ('marseykaiser',2,'prussian history wwi rifle reich wilhelm germany soldier',NULL), ('marseykamikaze',2,'kamikaze japanese nip pilot ww2 wwii world war',NULL), ('marseykatamarireddit',2,'rolling animated vidya video game damaci damacy reddit',NULL), @@ -2374,6 +2376,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES ('marseyreindeer2',2,'santa christmas rudolf holiday',NULL), ('marseyreindeer3',2,'rudolf dasher dancer prancer vixen comet cupid donner blitzen santa sleigh sled christmas winter holiday',NULL), ('marseyreindeer4',2,'rudolf dasher dancer prancer vixen comet cupid donner blitzen santa sleigh sled christmas winter holiday',NULL), +('marseyrelevancy',2,'darrell brooks court relevancy relevance',1665785008), ('marseyreluctant',2,'stare doubt skeptical wary cautious uncertain uhh umm',NULL), ('marseyremastered',2,'4k hd hi def hidef high definition uhd rtx',NULL), ('marseyrentfree',2,'reaction no charge obsessed obsession',NULL), @@ -2645,6 +2648,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES ('marseysylveon',2,'trick or treat pokemon halloween eevee costume holiday',NULL), ('marseytabletired',2,'tiresome depressed sad desk',NULL), ('marseytabletired2',2,'beer tiresome depressed sad alcoholic alcoholism despair',NULL), +('marseytakit',2,'darrell brooks court takit tacit agreement',1665785068), ('marseytaliban',2,'mujahideen janniejihad islam afganistan shariah afghanistan muslim',NULL), ('marseytalking',2,'speech bubble smug gossip',NULL), ('marseytampon',2,'period menstrual menses menstruation bloody',NULL),