From 5bd94df4a6afa6163f52870d75317963e89182b6 Mon Sep 17 00:00:00 2001 From: chme Date: Mon, 21 May 2018 06:55:07 +0200 Subject: [PATCH] [mpd] Add listfiles command For now listfiles simply returns the same result as lsinfo (no support for listing files not part of the library) --- src/mpd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mpd.c b/src/mpd.c index c349045b..0cc77757 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -3093,6 +3093,18 @@ mpd_command_lsinfo(struct evbuffer *evbuf, int argc, char **argv, char **errmsg, return ret; } +/* + * Command handler function for 'listfiles' + * + * This command should list all files including files that are not part of the library. We do not support this + * and only report files in the library. + */ +static int +mpd_command_listfiles(struct evbuffer *evbuf, int argc, char **argv, char **errmsg, struct mpd_client_ctx *ctx) +{ + return mpd_command_lsinfo(evbuf, argc, argv, errmsg, ctx); +} + /* * Command handler function for 'search' * Lists any song that matches the given list of arguments. Arguments are pairs of TYPE and WHAT, where @@ -4118,7 +4130,7 @@ static struct mpd_command mpd_handlers[] = { "list", mpd_command_list, -1 }, { "listall", mpd_command_listall, -1 }, { "listallinfo", mpd_command_listallinfo, -1 }, -// { "listfiles", mpd_command_listfiles, -1 }, + { "listfiles", mpd_command_listfiles, -1 }, { "lsinfo", mpd_command_lsinfo, -1 }, // { "readcomments", mpd_command_readcomments, -1 }, { "search", mpd_command_search, -1 },