diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 11:11:14 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 11:11:14 +0200 |
commit | 941d4f27ef5337c5be5553f93e41aed7745c71e1 (patch) | |
tree | 21ab08f45c8e2bf600b2447aa1b7cc93991765da /libpiano/main.c | |
parent | c92cbed15b69d823637fb565fefeb6acc3ce178e (diff) | |
download | pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.tar.gz pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.tar.bz2 pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.zip |
Return success/error in PianoRateTrack
Diffstat (limited to 'libpiano/main.c')
-rw-r--r-- | libpiano/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libpiano/main.c b/libpiano/main.c index 0a14311..25fad38 100644 --- a/libpiano/main.c +++ b/libpiano/main.c @@ -218,10 +218,11 @@ void PianoGetPlaylist (PianoHandle_t *ph, char *stationId) { free (requestStr); } -void PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station, +PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station, PianoSong_t *song, PianoSongRating_t rating) { char xmlSendBuf[10000], url[PIANO_URL_BUFFER_SIZE]; char *requestStr, *retStr; + PianoReturn_t ret = PIANO_RET_ERR; snprintf (xmlSendBuf, sizeof (xmlSendBuf), "<?xml version=\"1.0\"?>" "<methodCall><methodName>station.addFeedback</methodName>" @@ -245,7 +246,9 @@ void PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station, song->matchingSeed, song->userSeed, song->focusTraitId, (rating == PIANO_RATE_LOVE) ? "true" : "false"); PianoHttpPost (ph->curlHandle, url, requestStr, &retStr); - /* FIXME: check answer (success = <?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value>1</value></param></params></methodResponse> ) */ + ret = PianoXmlParseRate (retStr); free (requestStr); free (retStr); + + return ret; } |