add cw search + order params alphabetically
parent
4fe17a5dd7
commit
3d2cd78e0a
|
@ -11,17 +11,18 @@ from files.routes.wrappers import *
|
||||||
from files.__main__ import app
|
from files.__main__ import app
|
||||||
|
|
||||||
valid_params = [
|
valid_params = [
|
||||||
|
'after',
|
||||||
'author',
|
'author',
|
||||||
|
'before',
|
||||||
|
'cw'
|
||||||
'domain',
|
'domain',
|
||||||
|
'exact',
|
||||||
|
'hole',
|
||||||
'nsfw',
|
'nsfw',
|
||||||
'post',
|
'post',
|
||||||
'before',
|
|
||||||
'after',
|
|
||||||
'exact',
|
|
||||||
'title',
|
|
||||||
'sentto',
|
'sentto',
|
||||||
'hole',
|
|
||||||
'subreddit',
|
'subreddit',
|
||||||
|
'title',
|
||||||
]
|
]
|
||||||
|
|
||||||
def searchparse(text):
|
def searchparse(text):
|
||||||
|
@ -110,6 +111,8 @@ def searchposts(v):
|
||||||
) for x in criteria['q']]
|
) for x in criteria['q']]
|
||||||
posts = posts.filter(*words)
|
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 'nsfw' in criteria: posts = posts.filter(Post.nsfw==True)
|
||||||
|
|
||||||
if 'domain' in criteria:
|
if 'domain' in criteria:
|
||||||
|
|
Loading…
Reference in New Issue