[db] Replace sqlite3_xxx() calls outside db.c/cache.c so they are abstracted

This commit is contained in:
ejurgensen
2017-10-14 20:16:34 +02:00
parent 659b5c70c4
commit 88a565ea2c
7 changed files with 95 additions and 81 deletions

View File

@@ -1765,12 +1765,13 @@ playlist_add_files(FILE *fp, int pl_id, const char *virtual_path)
qp.type = Q_ITEMS;
qp.sort = S_ARTIST;
qp.idx_type = I_NONE;
qp.filter = sqlite3_mprintf("(f.virtual_path = %Q OR f.virtual_path LIKE '%q/%%')", virtual_path, virtual_path);
qp.filter = db_mprintf("(f.virtual_path = %Q OR f.virtual_path LIKE '%q/%%')", virtual_path, virtual_path);
ret = db_query_start(&qp);
if (ret < 0)
{
db_query_end(&qp);
free(qp.filter);
return -1;
}
@@ -1791,6 +1792,7 @@ playlist_add_files(FILE *fp, int pl_id, const char *virtual_path)
}
db_query_end(&qp);
free(qp.filter);
return ret;
}