Improve parameter parsing

This commit is contained in:
magmaus3 2022-10-30 16:38:25 +01:00
parent 3c61696bbd
commit baf6b15e17
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251

View file

@ -66,9 +66,8 @@ async def search(
min_diff = 0.00 min_diff = 0.00
max_diff = 5.00 max_diff = 5.00
params = re.findall("[a-z\-\_]*:[a-zA-Z0-9_\-]*", q) params = re.findall("[a-z\-\_]*:[a-zA-Z0-9._\-]*", q)
search = re.sub("[a-z\-\_]*:[a-zA-Z0-9_\-]*", "", q) search = re.sub("\S[a-z\-\_]*:[a-zA-Z0-9._\-]*", "", q).lstrip().rstrip()
for i in params: for i in params:
split = i.split(':') split = i.split(':')
if split[0] == "author": if split[0] == "author":