From 4170ad55dc80e0507ca4113b9adeb025a66ede05 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 10 Jun 2008 20:46:41 +0200 Subject: 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? --- libpiano/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libpiano') 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, "0" "", 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); -- cgit v1.2.3