From 17022c91031c92a200fa6c03b5aefe5bfdcd8e1e Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Fri, 1 Feb 2019 15:50:41 +0000 Subject: [PATCH] [jsonapi] expose albumid/artistid persistent id on queue object --- src/httpd_jsonapi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index f640acc2..551ba011 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -1654,6 +1654,19 @@ queue_item_to_json(struct db_queue_item *queue_item, char shuffle) safe_json_add_string(item, "composer", queue_item->composer); safe_json_add_string(item, "genre", queue_item->genre); + if (queue_item->songartistid > 0) + { + ret = snprintf(uri, sizeof(uri), "%" PRIi64, queue_item->songartistid); + if (ret < sizeof(uri)) + json_object_object_add(item, "albumartist_id", json_object_new_string(uri)); + } + if (queue_item->songalbumid > 0) + { + ret = snprintf(uri, sizeof(uri), "%" PRIi64, queue_item->songalbumid); + if (ret < sizeof(uri)) + json_object_object_add(item, "album_id", json_object_new_string(uri)); + } + json_object_object_add(item, "year", json_object_new_int(queue_item->year)); json_object_object_add(item, "track_number", json_object_new_int(queue_item->track)); json_object_object_add(item, "disc_number", json_object_new_int(queue_item->disc));