Make tag parsing more robust

This commit is contained in:
2022-08-11 23:17:45 +01:00
parent 7791e96809
commit 733ca0eef3

View File

@@ -48,7 +48,7 @@ def create_tags(query):
spl = query.split("AND") spl = query.split("AND")
spl = [x.strip() for x in spl if ":" in x] spl = [x.strip() for x in spl if ":" in x]
spl = [x.replace('"', "") for x in spl] spl = [x.replace('"', "") for x in spl]
tags = [f"{tag}: {elem}" for tag, elem in [x.split(":") for x in spl]] tags = [f"{tag}: {elem}" for tag, elem in [x.split(":")[:2] for x in spl]]
return tags return tags