summaryrefslogtreecommitdiff
path: root/src/libpiano/response.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2017-10-07 12:02:57 +0200
committerLars-Dominik Braun <lars@6xq.net>2017-10-07 12:02:57 +0200
commit2db7a3cca6ec47c00e9691bf3f8f588db0332a52 (patch)
tree9317977e6326c2f42d9d74694dc3c3dabf0876aa /src/libpiano/response.c
parent4dfca5b56b441faf4938b6c8e97585f68e468039 (diff)
downloadpianobar-2db7a3cca6ec47c00e9691bf3f8f588db0332a52.tar.gz
pianobar-2db7a3cca6ec47c00e9691bf3f8f588db0332a52.tar.bz2
pianobar-2db7a3cca6ec47c00e9691bf3f8f588db0332a52.zip
piano: Fetch extended attribs for station info
We can show the song length in the feedback list now.
Diffstat (limited to 'src/libpiano/response.c')
-rw-r--r--src/libpiano/response.c5
1 files changed, 5 insertions, 0 deletions
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);
}