mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 00:23:23 -05:00
[mpd] Return playlists if lsinfo is called with an empty path (same
handling as if the path is the root directory "/")
This commit is contained in:
parent
316af87189
commit
d0232a2315
22
src/mpd.c
22
src/mpd.c
@ -2675,17 +2675,6 @@ mpd_command_lsinfo(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
|||||||
int print_playlists;
|
int print_playlists;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
print_playlists = 0;
|
|
||||||
if (argc > 1 && strncmp(argv[1], "/", 1) == 0 && strlen(argv[1]) == 1)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Special handling necessary if the root directory '/' is given.
|
|
||||||
* In this case additional to the directory contents the stored playlists will be returned.
|
|
||||||
* This behavior is deprecated in the mpd protocol but clients like ncmpccp or ympd uses it.
|
|
||||||
*/
|
|
||||||
print_playlists = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (argc < 2 || strlen(argv[1]) == 0
|
if (argc < 2 || strlen(argv[1]) == 0
|
||||||
|| (strncmp(argv[1], "/", 1) == 0 && strlen(argv[1]) == 1))
|
|| (strncmp(argv[1], "/", 1) == 0 && strlen(argv[1]) == 1))
|
||||||
{
|
{
|
||||||
@ -2706,6 +2695,17 @@ mpd_command_lsinfo(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_playlists = 0;
|
||||||
|
if (argc > 1 && (strncmp(parent, "/", 1) == 0 && strlen(parent) == 1))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Special handling necessary if the root directory '/' is given.
|
||||||
|
* In this case additional to the directory contents the stored playlists will be returned.
|
||||||
|
* This behavior is deprecated in the mpd protocol but clients like ncmpccp or ympd uses it.
|
||||||
|
*/
|
||||||
|
print_playlists = 1;
|
||||||
|
}
|
||||||
|
|
||||||
fi = (struct filelist_info*)malloc(sizeof(struct filelist_info));
|
fi = (struct filelist_info*)malloc(sizeof(struct filelist_info));
|
||||||
if (!fi)
|
if (!fi)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user