From 9616cfdf0cdadd2c43dd88f21d5c3968f9bef39e Mon Sep 17 00:00:00 2001 From: chme Date: Tue, 30 Jun 2020 09:31:10 +0200 Subject: [PATCH] [jsonapi] harmonize "channels" attribute in queue item and track object --- src/httpd_jsonapi.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index 5e731e52..9dbfb3a4 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -2058,8 +2058,6 @@ queue_item_to_json(struct db_queue_item *queue_item, char shuffle) json_object *item; char uri[100]; char artwork_url[100]; - char chbuf[6]; - const char *ch; int ret; item = json_object_new_object(); @@ -2139,15 +2137,7 @@ queue_item_to_json(struct db_queue_item *queue_item, char shuffle) safe_json_add_string(item, "type", queue_item->type); json_object_object_add(item, "bitrate", json_object_new_int(queue_item->bitrate)); json_object_object_add(item, "samplerate", json_object_new_int(queue_item->samplerate)); - switch (queue_item->channels) - { - case 1: ch = "mono"; break; - case 2: ch = "stereo"; break; - default: - snprintf(chbuf, sizeof(chbuf), "%d ch", queue_item->channels); - ch = chbuf; - } - safe_json_add_string(item, "channels", ch); + json_object_object_add(item, "channels", json_object_new_int(queue_item->channels)); return item; }