mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-24 03:27:46 -05:00
Move client protocol specific make_queue functions out of player.c/h
This commit is contained in:
31
src/mpd.c
31
src/mpd.c
@@ -1506,6 +1506,37 @@ mpd_command_stop(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct player_source *
|
||||
player_queue_make_mpd(char *path, int recursive)
|
||||
{
|
||||
struct query_params qp;
|
||||
struct player_source *ps;
|
||||
|
||||
memset(&qp, 0, sizeof(struct query_params));
|
||||
|
||||
qp.type = Q_ITEMS;
|
||||
qp.idx_type = I_NONE;
|
||||
qp.sort = S_ALBUM;
|
||||
|
||||
if (recursive)
|
||||
{
|
||||
qp.filter = sqlite3_mprintf("f.virtual_path LIKE '/%q%%'", path);
|
||||
if (!qp.filter)
|
||||
DPRINTF(E_DBG, L_PLAYER, "Out of memory\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
|
||||
sqlite3_free(qp.filter);
|
||||
return ps;
|
||||
}
|
||||
|
||||
/*
|
||||
* Command handler function for 'add'
|
||||
* Adds the all songs under the given path to the end of the playqueue (directories add recursively).
|
||||
|
||||
Reference in New Issue
Block a user