[mpd] fixes for commands noidle, list (handle special case with second

argument 'album'), addid (sql error if virtual path contains
character ') and fix error messages in various commands
This commit is contained in:
chme
2015-02-24 19:24:53 +01:00
parent a7f15eadd3
commit 4a1bff500a
2 changed files with 36 additions and 29 deletions

View File

@@ -1028,7 +1028,6 @@ player_queue_make_mpd(char *path, int recursive)
{
struct query_params qp;
struct player_source *ps;
int ret;
memset(&qp, 0, sizeof(struct query_params));
@@ -1038,20 +1037,20 @@ player_queue_make_mpd(char *path, int recursive)
if (recursive)
{
ret = asprintf(&(qp.filter), "f.virtual_path LIKE '/%s%%'", path);
if (ret < 0)
qp.filter = sqlite3_mprintf("f.virtual_path LIKE '/%q%%'", path);
if (!qp.filter)
DPRINTF(E_DBG, L_PLAYER, "Out of memory\n");
}
else
{
ret = asprintf(&(qp.filter), "f.virtual_path LIKE '/%s'", path);
if (ret < 0)
qp.filter = sqlite3_mprintf("f.virtual_path LIKE '/%q'", path);
if (!qp.filter)
DPRINTF(E_DBG, L_PLAYER, "Out of memory\n");
}
ps = player_queue_make(&qp, NULL);
free(qp.filter);
sqlite3_free(qp.filter);
return ps;
}