diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-08-10 10:36:03 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-08-10 10:40:50 +0200 |
commit | 3a196f51581ffca2d2a902e83a9b69ac4702316c (patch) | |
tree | e19c3474e46ab4da4c9f08a24f0082cc3290c7e8 /src/libpiano/response.c | |
parent | bf814cabd1e9913d6153b65f97ad851be3da9b29 (diff) | |
download | pianobar-3a196f51581ffca2d2a902e83a9b69ac4702316c.tar.gz pianobar-3a196f51581ffca2d2a902e83a9b69ac4702316c.tar.bz2 pianobar-3a196f51581ffca2d2a902e83a9b69ac4702316c.zip |
Add feature to change Pandora settings
Currently exposed settings: Username, password and explicit content
filter. New key for settings is ‘!’, changeable with “act_settings”.
Fixes issues #524 and #506.
Diffstat (limited to 'src/libpiano/response.c')
-rw-r--r-- | src/libpiano/response.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libpiano/response.c b/src/libpiano/response.c index b530f3a..542ef00 100644 --- a/src/libpiano/response.c +++ b/src/libpiano/response.c @@ -411,6 +411,7 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { case PIANO_REQUEST_BOOKMARK_ARTIST: case PIANO_REQUEST_DELETE_FEEDBACK: case PIANO_REQUEST_DELETE_SEED: + case PIANO_REQUEST_CHANGE_SETTINGS: /* response unused */ break; @@ -508,6 +509,17 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { break; } + case PIANO_REQUEST_GET_SETTINGS: { + PianoSettings_t * const settings = req->data; + + assert (settings != NULL); + + settings->explicitContentFilter = json_object_get_boolean ( + json_object_object_get (result, "isExplicitContentFilterEnabled")); + settings->username = PianoJsonStrdup (result, "username"); + break; + } + case PIANO_REQUEST_GET_STATION_INFO: { /* get station information (seeds and feedback) */ PianoRequestDataGetStationInfo_t *reqData = req->data; |