[jsonapi] Return number of items added in queue/items/add endpoint

response
This commit is contained in:
chme
2018-12-17 19:03:34 +01:00
parent 2b7ff60771
commit dcbe503686
2 changed files with 23 additions and 2 deletions

View File

@@ -1745,6 +1745,7 @@ jsonapi_reply_queue_tracks_add(struct httpd_request *hreq)
const char *id;
int pos = -1;
int count = 0;
json_object *reply;
int ret = 0;
@@ -1814,10 +1815,19 @@ jsonapi_reply_queue_tracks_add(struct httpd_request *hreq)
free(uris);
if (ret == 0)
{
reply = json_object_new_object();
json_object_object_add(reply, "count", json_object_new_int(count));
ret = evbuffer_add_printf(hreq->reply, "%s", json_object_to_json_string(reply));
jparse_free(reply);
}
if (ret < 0)
return HTTP_INTERNAL;
return HTTP_NOCONTENT;
return HTTP_OK;
}
static int