OVER_18_EMOJIS -> NSFW_EMOJIS

master
Aevann 2023-12-25 03:18:48 +02:00
parent 9b155efa94
commit 31ee3e9f44
7 changed files with 15 additions and 15 deletions

View File

@ -20,11 +20,11 @@ from files.helpers.sorting_and_time import *
from .saves import CommentSaveRelationship
def get_emoji_awards_emojis(obj, v, kind, OVER_18_EMOJIS):
def get_emoji_awards_emojis(obj, v, kind, NSFW_EMOJIS):
if g.show_nsfw:
emojis = [x.note for x in obj.awards if x.kind == kind]
else:
emojis = [x.note for x in obj.awards if x.kind == kind and x.note not in OVER_18_EMOJIS]
emojis = [x.note for x in obj.awards if x.kind == kind and x.note not in NSFW_EMOJIS]
return reversed(emojis[:20])
def get_award_classes(obj, v, title=False):
@ -512,8 +512,8 @@ class Comment(Base):
return get_award_classes(self, v)
@lazy
def emoji_awards_emojis(self, v, kind, OVER_18_EMOJIS):
return get_emoji_awards_emojis(self, v, kind, OVER_18_EMOJIS)
def emoji_awards_emojis(self, v, kind, NSFW_EMOJIS):
return get_emoji_awards_emojis(self, v, kind, NSFW_EMOJIS)
@property
@lazy

View File

@ -390,8 +390,8 @@ class Post(Base):
return get_award_classes(self, v, title)
@lazy
def emoji_awards_emojis(self, v, kind, OVER_18_EMOJIS):
return get_emoji_awards_emojis(self, v, kind, OVER_18_EMOJIS)
def emoji_awards_emojis(self, v, kind, NSFW_EMOJIS):
return get_emoji_awards_emojis(self, v, kind, NSFW_EMOJIS)
@property
@lazy

View File

@ -12,10 +12,10 @@ SNAPPY_QUOTES = []
SNAPPY_QUOTES_FISTMAS = []
SNAPPY_QUOTES_HOMOWEEN = []
STEALTH_HOLES = []
OVER_18_EMOJIS = []
NSFW_EMOJIS = []
def const_initialize():
global MARSEYS_CONST, MARSEYS_CONST2, MARSEY_MAPPINGS, SNAPPY_KONGS, SNAPPY_MARSEYS, SNAPPY_QUOTES, SNAPPY_QUOTES_FISTMAS, SNAPPY_QUOTES_HOMOWEEN, STEALTH_HOLES, OVER_18_EMOJIS
global MARSEYS_CONST, MARSEYS_CONST2, MARSEY_MAPPINGS, SNAPPY_KONGS, SNAPPY_MARSEYS, SNAPPY_QUOTES, SNAPPY_QUOTES_FISTMAS, SNAPPY_QUOTES_HOMOWEEN, STEALTH_HOLES, NSFW_EMOJIS
db = db_session()
@ -35,7 +35,7 @@ def const_initialize():
STEALTH_HOLES = [x[0] for x in db.query(Hole.name).filter_by(stealth=True)]
OVER_18_EMOJIS = [x[0] for x in db.query(Emoji.name).filter_by(nsfw=True)]
NSFW_EMOJIS = [x[0] for x in db.query(Emoji.name).filter_by(nsfw=True)]
db.commit()
db.close()

View File

@ -531,7 +531,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
if FEATURES['NSFW_MARKING'] and obj:
for emoji in emojis_used:
if emoji in OVER_18_EMOJIS:
if emoji in NSFW_EMOJIS:
obj.nsfw = True
break
@ -702,7 +702,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
if FEATURES['NSFW_MARKING'] and obj:
for emoji in emojis_used:
if emoji in OVER_18_EMOJIS:
if emoji in NSFW_EMOJIS:
obj.nsfw = True
break

View File

@ -238,7 +238,7 @@ def approve_emoji(v, name):
g.db.add(ma)
if emoji.nsfw:
OVER_18_EMOJIS.append(emoji.name)
NSFW_EMOJIS.append(emoji.name)
g.db.commit()

View File

@ -14,7 +14,7 @@ from files.classes.orgy import get_running_orgy
from files.classes.emoji import Emoji
from files.helpers.assetcache import assetcache_path
from files.helpers.config.const import *
from files.helpers.const_stateful import OVER_18_EMOJIS
from files.helpers.const_stateful import NSFW_EMOJIS
from files.helpers.regex import *
from files.helpers.settings import *
from files.helpers.cloudflare import *
@ -154,7 +154,7 @@ def inject_constants():
"SITE_FULL_IMAGES": SITE_FULL_IMAGES,
"IS_EVENT":IS_EVENT, "IS_FISTMAS":IS_FISTMAS, "IS_HOMOWEEN":IS_HOMOWEEN,
"IS_DKD":IS_DKD, "IS_BIRTHGAY":IS_BIRTHGAY, "IS_BIRTHDEAD":IS_BIRTHDEAD,
"CHUD_PHRASES":CHUD_PHRASES, "hasattr":hasattr, "calc_users":calc_users, "HOLE_INACTIVITY_DELETION":HOLE_INACTIVITY_DELETION, "LIGHT_THEMES":LIGHT_THEMES, "OVER_18_EMOJIS":OVER_18_EMOJIS,
"CHUD_PHRASES":CHUD_PHRASES, "hasattr":hasattr, "calc_users":calc_users, "HOLE_INACTIVITY_DELETION":HOLE_INACTIVITY_DELETION, "LIGHT_THEMES":LIGHT_THEMES, "NSFW_EMOJIS":NSFW_EMOJIS,
"MAX_IMAGE_AUDIO_SIZE_MB":MAX_IMAGE_AUDIO_SIZE_MB, "MAX_IMAGE_AUDIO_SIZE_MB_PATRON":MAX_IMAGE_AUDIO_SIZE_MB_PATRON,
"MAX_VIDEO_SIZE_MB":MAX_VIDEO_SIZE_MB, "MAX_VIDEO_SIZE_MB_PATRON":MAX_VIDEO_SIZE_MB_PATRON,
"CURSORMARSEY_DEFAULT":CURSORMARSEY_DEFAULT, "SNAPPY_ID":SNAPPY_ID, "get_running_orgy":get_running_orgy, "TRUESCORE_MINIMUM":TRUESCORE_MINIMUM, "bar_position":bar_position, "datetime":datetime, "CSS_LENGTH_LIMIT":CSS_LENGTH_LIMIT, "cache":cache, "emoji_count":emoji_count, "HOLE_SIDEBAR_COLUMN_LENGTH":HOLE_SIDEBAR_COLUMN_LENGTH,

View File

@ -12,7 +12,7 @@
{% if p.award_count("emoji", v) or p.award_count("emoji-hz", v) %}
{% for kind in ["emoji", "emoji-hz"] %}
<div class="stackable-container">
{% for emoji in p.emoji_awards_emojis(v, kind, OVER_18_EMOJIS) %}
{% for emoji in p.emoji_awards_emojis(v, kind, NSFW_EMOJIS) %}
{% set src = '/e/' + emoji + '.webp' %}
{% set alt = 'emoji-award-' + emoji %}
{% set delay = 'animation-delay-' ~ ((loop.index-1)/4)|int %}