summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-10 20:46:41 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-10 20:46:41 +0200
commit4170ad55dc80e0507ca4113b9adeb025a66ede05 (patch)
tree1f539844ebbe31fd191fbf4cec81d9b4aa469afb
parent9424d920f2629738121d14970b511695c22699f9 (diff)
downloadpianobar-windows-4170ad55dc80e0507ca4113b9adeb025a66ede05.tar.gz
pianobar-windows-4170ad55dc80e0507ca4113b9adeb025a66ede05.tar.bz2
pianobar-windows-4170ad55dc80e0507ca4113b9adeb025a66ede05.zip
Try to fix rate track
Sometimes focusTraitId is missing. This would produce (null) which messes up pandora and returns an error. Maybe an empty string is better?
-rw-r--r--libpiano/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpiano/main.c b/libpiano/main.c
index 2727719..d21c91b 100644
--- a/libpiano/main.c
+++ b/libpiano/main.c
@@ -219,7 +219,7 @@ void PianoGetPlaylist (PianoHandle_t *ph, char *stationId) {
}
/* love or ban track (you cannot remove your rating, so PIANO_RATE_NONE is
- * not allowed
+ * not allowed)
* @author PromyLOPh
* @added 2008-06-10
* @public yes
@@ -248,13 +248,16 @@ PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
"<param><value><boolean>0</boolean></value></param>"
"</params></methodCall>", time (NULL), ph->user.authToken,
station->id, song->musicId, song->matchingSeed, song->userSeed,
- song->focusTraitId, (rating == PIANO_RATE_LOVE) ? 1 : 0);
+ /* sometimes focusTraitId is not set, dunno why yet */
+ (song->focusTraitId == NULL) ? "" : song->focusTraitId,
+ (rating == PIANO_RATE_LOVE) ? 1 : 0);
requestStr = PianoEncryptString (xmlSendBuf);
snprintf (url, sizeof (url), PIANO_RPC_URL
"rid=%s&lid=%s&method=addFeedback&arg1=%s&arg2=%s"
"&arg3=%s&arg4=%s&arg5=%s&arg6=%s&arg7=false", ph->routeId,
ph->user.listenerId, station->id, song->musicId,
- song->matchingSeed, song->userSeed, song->focusTraitId,
+ song->matchingSeed, song->userSeed,
+ (song->focusTraitId == NULL) ? "" : song->focusTraitId,
(rating == PIANO_RATE_LOVE) ? "true" : "false");
PianoHttpPost (ph->curlHandle, url, requestStr, &retStr);
ret = PianoXmlParseRate (retStr);