summaryrefslogtreecommitdiff
path: root/src/libpiano
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-03-21 12:57:56 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-03-21 12:57:56 +0100
commitc9a55302305ec070cc03f4329e26b98f8034cefc (patch)
treeaa0b2636bc795d488f818a847a7154b57a3f3ffb /src/libpiano
parent3ce6e179a94e6000d8dc08650a3614a13a8f29f4 (diff)
downloadpianobar-windows-c9a55302305ec070cc03f4329e26b98f8034cefc.tar.gz
pianobar-windows-c9a55302305ec070cc03f4329e26b98f8034cefc.tar.bz2
pianobar-windows-c9a55302305ec070cc03f4329e26b98f8034cefc.zip
piano: Delete feedback
Diffstat (limited to 'src/libpiano')
-rw-r--r--src/libpiano/piano.c21
-rw-r--r--src/libpiano/piano.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c
index e475799..9075df7 100644
--- a/src/libpiano/piano.c
+++ b/src/libpiano/piano.c
@@ -735,6 +735,26 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
break;
}
+ case PIANO_REQUEST_DELETE_FEEDBACK: {
+ PianoSong_t *song = req->data;
+
+ assert (song != NULL);
+
+ snprintf (xmlSendBuf, sizeof (xmlSendBuf), "<?xml version=\"1.0\"?>"
+ "<methodCall><methodName>station.deleteFeedback</methodName>"
+ "<params><param><value><int>%lu</int></value></param>"
+ /* auth token */
+ "<param><value><string>%s</string></value></param>"
+ /* feedback id */
+ "<param><value><string>%s</string></value></param>"
+ "</params></methodCall>", (unsigned long) timestamp,
+ ph->user.authToken, song->feedbackId);
+ snprintf (req->urlPath, sizeof (req->urlPath), PIANO_RPC_PATH
+ "rid=%s&lid=%s&method=deleteFeedback&arg1=%s",
+ ph->routeId, ph->user.listenerId, song->feedbackId);
+ break;
+ }
+
/* "high-level" wrapper */
case PIANO_REQUEST_RATE_SONG: {
/* love/ban song */
@@ -1006,6 +1026,7 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) {
case PIANO_REQUEST_SET_QUICKMIX:
case PIANO_REQUEST_BOOKMARK_SONG:
case PIANO_REQUEST_BOOKMARK_ARTIST:
+ case PIANO_REQUEST_DELETE_FEEDBACK:
assert (req->responseData != NULL);
ret = PianoXmlParseSimple (req->responseData);
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index c91b7e9..d013363 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -144,6 +144,7 @@ typedef enum {
PIANO_REQUEST_BOOKMARK_SONG = 18,
PIANO_REQUEST_BOOKMARK_ARTIST = 19,
PIANO_REQUEST_GET_STATION_INFO = 20,
+ PIANO_REQUEST_DELETE_FEEDBACK = 21,
} PianoRequestType_t;
typedef struct PianoRequest {