From e9f92ba1a7251eec91de3af7817c971902f8cdd8 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Mon, 24 Dec 2018 19:26:26 +0000 Subject: [PATCH] [jsonapi] correct count of tracks added returned --- src/httpd_jsonapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index 71260f84..3a0dd53b 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -1745,6 +1745,7 @@ jsonapi_reply_queue_tracks_add(struct httpd_request *hreq) const char *id; int pos = -1; int count = 0; + int ttl_count = 0; json_object *reply; int ret = 0; @@ -1810,6 +1811,8 @@ jsonapi_reply_queue_tracks_add(struct httpd_request *hreq) if (pos >= 0) pos += count; + + ttl_count += count; } while ((uri = strtok(NULL, ","))); @@ -1818,7 +1821,7 @@ jsonapi_reply_queue_tracks_add(struct httpd_request *hreq) if (ret == 0) { reply = json_object_new_object(); - json_object_object_add(reply, "count", json_object_new_int(count)); + json_object_object_add(reply, "count", json_object_new_int(ttl_count)); ret = evbuffer_add_printf(hreq->reply, "%s", json_object_to_json_string(reply)); jparse_free(reply);