diff options
Diffstat (limited to 'libpiano')
-rw-r--r-- | libpiano/src/main.c | 16 | ||||
-rw-r--r-- | libpiano/src/piano.h | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/libpiano/src/main.c b/libpiano/src/main.c index 4e72629..904dd65 100644 --- a/libpiano/src/main.c +++ b/libpiano/src/main.c @@ -498,10 +498,12 @@ PianoReturn_t PianoSearchMusic (PianoHandle_t *ph, char *searchStr, /* create new station on server * @public yes * @param piano handle - * @param music id from artist or track, you may obtain one by calling - * PianoSearchMusic + * @param type: "mi" for music id (from music search) or "sh" for + * shared station + * @param id */ -PianoReturn_t PianoCreateStation (PianoHandle_t *ph, char *musicId) { +PianoReturn_t PianoCreateStation (PianoHandle_t *ph, char *type, + char *id) { char xmlSendBuf[10000], url[PIANO_URL_BUFFER_SIZE]; char *requestStr, *retStr; PianoReturn_t ret; @@ -510,14 +512,14 @@ PianoReturn_t PianoCreateStation (PianoHandle_t *ph, char *musicId) { "<methodCall><methodName>station.createStation</methodName>" "<params><param><value><int>%li</int></value></param>" "<param><value><string>%s</string></value></param>" - "<param><value><string>mi%s</string></value></param>" + "<param><value><string>%s%s</string></value></param>" "</params></methodCall>", time (NULL), ph->user.authToken, - musicId); + type, id); requestStr = PianoEncryptString (xmlSendBuf); snprintf (url, sizeof (url), PIANO_RPC_URL "rid=%s&lid=%s" - "&method=createStation&arg1=mi%s", ph->routeId, - ph->user.listenerId, musicId); + "&method=createStation&arg1=%s%s", ph->routeId, + ph->user.listenerId, type, id); PianoHttpPost (ph->curlHandle, url, requestStr, &retStr); ret = PianoXmlParseCreateStation (ph, retStr); diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h index 7ee69fa..2e67424 100644 --- a/libpiano/src/piano.h +++ b/libpiano/src/piano.h @@ -164,7 +164,8 @@ PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station, PianoReturn_t PianoDeleteStation (PianoHandle_t *ph, PianoStation_t *station); PianoReturn_t PianoSearchMusic (PianoHandle_t *ph, char *searchStr, PianoSearchResult_t *searchResult); -PianoReturn_t PianoCreateStation (PianoHandle_t *ph, char *musicId); +PianoReturn_t PianoCreateStation (PianoHandle_t *ph, char *type, + char *id); PianoReturn_t PianoStationAddMusic (PianoHandle_t *ph, PianoStation_t *station, char *musicId); PianoReturn_t PianoSongTired (PianoHandle_t *ph, PianoSong_t *song); |