summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-12 17:18:00 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-12 17:18:00 +0200
commitfd978b5fa3ad57813c39d831d2bb7c4751d2adfd (patch)
treee2fa8426c1f497453804514ca736b9550e52d227
parent35c306d0e917a3fcbca30e9ad09a214e57548edd (diff)
downloadpianobar-fd978b5fa3ad57813c39d831d2bb7c4751d2adfd.tar.gz
pianobar-fd978b5fa3ad57813c39d831d2bb7c4751d2adfd.tar.bz2
pianobar-fd978b5fa3ad57813c39d831d2bb7c4751d2adfd.zip
lib: Update local data after rating track
This prevents the user from loving a track two times, e.g.
-rw-r--r--libpiano/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpiano/main.c b/libpiano/main.c
index 17bef4b..4d186a9 100644
--- a/libpiano/main.c
+++ b/libpiano/main.c
@@ -304,6 +304,11 @@ PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
(rating == PIANO_RATE_LOVE) ? "true" : "false");
PianoHttpPost (ph->curlHandle, url, requestStr, &retStr);
ret = PianoXmlParseSimple (retStr);
+
+ if (ret == PIANO_RET_OK) {
+ song->rating = rating;
+ }
+
free (requestStr);
free (retStr);