mirror of
https://github.com/searxng/searxng.git
synced 2026-01-01 08:30:01 +00:00
Enabled translations and fixed condition bug
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import shlex, string
|
||||
from flask_babel import gettext
|
||||
|
||||
name = "query strings"
|
||||
description = 'adds site:, - and "" to searx'
|
||||
name = gettext("query strings")
|
||||
description = gettext('adds site:, - and "" to searx')
|
||||
default_on = True
|
||||
|
||||
def on_result(request, search, result):
|
||||
@@ -12,9 +13,9 @@ def on_result(request, search, result):
|
||||
siteitems = [x.lower() for x in qs if x.startswith('site:')]
|
||||
msiteitems = [x.lower() for x in qs if x.startswith('-site:')]
|
||||
url, title, content = result["url"].lower(), result["title"].lower(), (result.get("content").lower() if result.get("content") else '')
|
||||
if all(x not in title or content for x in spitems):
|
||||
if all(x not in (title or content) for x in spitems):
|
||||
return False
|
||||
if all(x in title or content for x in mitems):
|
||||
if all(x in (title or content) for x in mitems):
|
||||
return False
|
||||
if all(x not in url for x in siteitems):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user