From 2db7a3cca6ec47c00e9691bf3f8f588db0332a52 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 7 Oct 2017 12:02:57 +0200 Subject: piano: Fetch extended attribs for station info We can show the song length in the feedback list now. --- src/libpiano/request.c | 3 +++ src/libpiano/response.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/libpiano/request.c b/src/libpiano/request.c index 66c34d7..2f9c91a 100644 --- a/src/libpiano/request.c +++ b/src/libpiano/request.c @@ -116,6 +116,7 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, case PIANO_REQUEST_GET_STATIONS: { /* get stations, user must be authenticated */ assert (ph->user.listenerId != NULL); + method = "user.getStationList"; break; } @@ -358,6 +359,8 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, json_object_new_string (reqData->station->id)); json_object_object_add (j, "includeExtendedAttributes", json_object_new_boolean (true)); + json_object_object_add (j, "includeExtraParams", + json_object_new_boolean (true)); method = "station.getStation"; break; diff --git a/src/libpiano/response.c b/src/libpiano/response.c index fd342ed..4b706e2 100644 --- a/src/libpiano/response.c +++ b/src/libpiano/response.c @@ -639,6 +639,11 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { feedbackSong->rating = getBoolDefault (s, "isPositive", false) ? PIANO_RATE_LOVE : PIANO_RATE_BAN; + json_object *v; + feedbackSong->length = + json_object_object_get_ex (s, "trackLength", &v) ? + json_object_get_int (v) : 0; + info->feedback = PianoListAppendP (info->feedback, feedbackSong); } -- cgit v1.2.3