diff --git a/soundboard.py b/soundboard.py index 3b5b582..40c5dfe 100644 --- a/soundboard.py +++ b/soundboard.py @@ -170,10 +170,10 @@ WHERE button.id IN ( GROUP BY button_tags.fk_button HAVING """ - tagFilter = "\t\tSUM(CASE WHEN tag.name = \"{}\" THEN 1 ELSE 0 END) > 0" + tagFilter = "\t\tSUM(CASE WHEN tag.name = ? THEN 1 ELSE 0 END) > 0" tagFilters = " AND \n".join([tagFilter.format(tag) for tag in tags.split(",")]) query += tagFilters + "\n)" - sounds = queryDB(query) + sounds = queryDB(query, tags.split(",")) return jsonify([sound["file"].split(".")[0] for sound in sounds])