[smartpl] Add ESCAPE to LIKE queries where the value contains % and _

Plus various minor improvements
This commit is contained in:
ejurgensen
2022-01-14 22:27:35 +01:00
parent 9233c03ca8
commit 9c1f7dd380
3 changed files with 34 additions and 24 deletions

View File

@@ -90,6 +90,8 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression)
{
struct smartpl_result result;
DPRINTF(E_SPAM, L_SCAN, "Parse smartpl query input '%s'\n", expression);
if (smartpl_lex_parse(&result, expression) != 0)
{
DPRINTF(E_LOG, L_SCAN, "Could not parse '%s': %s\n", expression, result.errmsg);
@@ -110,6 +112,9 @@ smartpl_query_parse_string(struct smartpl *smartpl, const char *expression)
smartpl->order = safe_strdup(result.order);
smartpl->limit = result.limit;
DPRINTF(E_SPAM, L_SCAN, "Parse smartpl query output '%s': WHERE %s HAVING %s ORDER BY %s LIMIT %d\n",
smartpl->title, smartpl->query_where, smartpl->having, smartpl->order, smartpl->limit);
return 0;
}