playlist: PlaylistInfo() does not call commandError()
Continuing the effort of removing protocol specific calls from the core libraries: let the command.c code call commandError() based on PlaylistInfo's return value.
This commit is contained in:
parent
a8b225f947
commit
d8ef33b710
@ -540,13 +540,25 @@ static int handleLoad(int fd, mpd_unused int *permission,
|
|||||||
static int handleListPlaylist(int fd, mpd_unused int *permission,
|
static int handleListPlaylist(int fd, mpd_unused int *permission,
|
||||||
mpd_unused int argc, char *argv[])
|
mpd_unused int argc, char *argv[])
|
||||||
{
|
{
|
||||||
return PlaylistInfo(fd, argv[1], 0);
|
int ret;
|
||||||
|
|
||||||
|
ret = PlaylistInfo(fd, argv[1], 0);
|
||||||
|
if (ret == -1)
|
||||||
|
commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist");
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handleListPlaylistInfo(int fd, mpd_unused int *permission,
|
static int handleListPlaylistInfo(int fd, mpd_unused int *permission,
|
||||||
mpd_unused int argc, char *argv[])
|
mpd_unused int argc, char *argv[])
|
||||||
{
|
{
|
||||||
return PlaylistInfo(fd, argv[1], 1);
|
int ret;
|
||||||
|
|
||||||
|
ret = PlaylistInfo(fd, argv[1], 1);
|
||||||
|
if (ret == -1)
|
||||||
|
commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist");
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handleLsInfo(int fd, mpd_unused int *permission,
|
static int handleLsInfo(int fd, mpd_unused int *permission,
|
||||||
|
@ -1342,11 +1342,8 @@ int PlaylistInfo(int fd, const char *utf8file, int detail)
|
|||||||
ListNode *node;
|
ListNode *node;
|
||||||
List *list;
|
List *list;
|
||||||
|
|
||||||
if (!(list = loadStoredPlaylist(utf8file))) {
|
if (!(list = loadStoredPlaylist(utf8file)))
|
||||||
commandError(fd, ACK_ERROR_NO_EXIST, "could not open playlist "
|
|
||||||
"\"%s\": %s", utf8file, strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
node = list->firstNode;
|
node = list->firstNode;
|
||||||
while (node != NULL) {
|
while (node != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user