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
committerMichał Cichoń <michcic@gmail.com>2018-10-30 12:05:24 +0100
commiteebc4b34e9f8b23f384205543e94d1278b6e63d5 (patch)
treeed9e3091404f7fef74ceab00bc0e0f762c80edd4 /src/libpiano/response.c
parented3ab2743344dfe2b38427733560b9847d259c8c (diff)
downloadpianobar-windows-eebc4b34e9f8b23f384205543e94d1278b6e63d5.tar.gz
pianobar-windows-eebc4b34e9f8b23f384205543e94d1278b6e63d5.tar.bz2
pianobar-windows-eebc4b34e9f8b23f384205543e94d1278b6e63d5.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 48a07db..fcc28b1 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);
}