add cw search + order params alphabetically

pull/220/head
G-tix 2023-12-21 19:54:05 +00:00
parent 4fe17a5dd7
commit 3d2cd78e0a
1 changed files with 8 additions and 5 deletions

View File

@ -11,17 +11,18 @@ from files.routes.wrappers import *
from files.__main__ import app
valid_params = [
'after',
'author',
'before',
'cw'
'domain',
'exact',
'hole',
'nsfw',
'post',
'before',
'after',
'exact',
'title',
'sentto',
'hole',
'subreddit',
'title',
]
def searchparse(text):
@ -110,6 +111,8 @@ def searchposts(v):
) for x in criteria['q']]
posts = posts.filter(*words)
if 'cw' in criteria: posts = posts.filter(Post.cw==True)
if 'nsfw' in criteria: posts = posts.filter(Post.nsfw==True)
if 'domain' in criteria: