remotes/1693045480750635534/spooky-22
Aevann1 2021-10-10 16:10:46 +02:00
parent 77d9309aa3
commit 728e4d1130
16 changed files with 31 additions and 33 deletions

View File

@ -266,7 +266,7 @@ class User(Base):
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":

View File

@ -84,8 +84,6 @@ allowed_styles =['color', 'font-weight', 'transform', '-webkit-transform']
def sanitize(sanitized, noimages=False):
sanitized = sanitized.replace("\ufeff", "").replace("m.youtube.com", "youtube.com")
sanitized = re.sub("</blockquote>$", "</blockquote><pre></pre>", sanitized)
sanitized = re.sub("^<blockquote>", "<pre></pre><blockquote>", sanitized)
for i in re.finditer('https://i.imgur.com/(([^_]*?)\.(jpg|png|jpeg))', sanitized):
sanitized = sanitized.replace(i.group(1), i.group(2) + "_d." + i.group(3) + "?maxwidth=9999")

View File

@ -199,7 +199,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":
@ -291,7 +291,7 @@ def changeloglist(v=None, sort="new", page=1 ,t="all"):
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":
@ -361,7 +361,7 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":

View File

@ -143,7 +143,7 @@ def post_id(pid, anything=None, v=None):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":
@ -168,7 +168,7 @@ def post_id(pid, anything=None, v=None):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":

View File

@ -132,7 +132,7 @@ def searchposts(v):
elif sort == "old":
posts = posts.order_by(Submission.created_utc.asc())
elif sort == "controversial":
posts = posts.order_by(-1 * Submission.upvotes * (Submission.downvotes+1))
posts = posts.order_by(-1 * Submission.upvotes * min(Submission.downvotes, 1))
elif sort == "top":
posts = posts.order_by(Submission.downvotes - Submission.upvotes)
elif sort == "bottom":
@ -235,7 +235,7 @@ def searchcomments(v):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":

View File

@ -572,7 +572,7 @@ def u_username_comments(username, v=None):
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc())
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * (Comment.downvotes+1))
comments = comments.order_by(-1 * Comment.upvotes * min(Comment.downvotes, 1))
elif sort == "top":
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":

View File

@ -15,11 +15,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=66">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=67">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
{% endif %}
</head>

View File

@ -250,12 +250,12 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=66">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=67">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=67">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
{% endif %}
{% endblock %}

View File

@ -17,11 +17,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=66">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=67">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
{% endif %}
<div class="row justify-content-around">

View File

@ -15,7 +15,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
</head>

View File

@ -12,7 +12,7 @@
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
</head>

View File

@ -55,8 +55,8 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=66">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=67">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
</head>

View File

@ -40,10 +40,10 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
{% endif %}
<link href="/assets/css/fa.css?v=52" rel="stylesheet">

View File

@ -36,7 +36,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
</head>

View File

@ -31,7 +31,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
</head>

View File

@ -25,12 +25,12 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=66">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=66">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=67"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=67">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=67">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=66">
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=66">
<link rel="stylesheet" href="/assets/css/main.css?v=67">
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=67">
{% endif %}
{% endblock %}