From 845cf4c1bdae57e8ed59bc3bb6fcaa7464c8904e Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 26 Jun 2012 18:17:54 +0200 Subject: piano: Remove move song MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doesn’t work with JSON API. See #280. --- src/libpiano/piano.h | 8 -------- src/libpiano/request.c | 36 ------------------------------------ src/libpiano/response.c | 15 --------------- 3 files changed, 59 deletions(-) (limited to 'src/libpiano') diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h index 167f0f9..e881621 100644 --- a/src/libpiano/piano.h +++ b/src/libpiano/piano.h @@ -147,7 +147,6 @@ typedef enum { PIANO_REQUEST_GET_PLAYLIST = 3, PIANO_REQUEST_RATE_SONG = 4, PIANO_REQUEST_ADD_FEEDBACK = 5, - PIANO_REQUEST_MOVE_SONG = 6, PIANO_REQUEST_RENAME_STATION = 7, PIANO_REQUEST_DELETE_STATION = 8, PIANO_REQUEST_SEARCH = 9, @@ -198,13 +197,6 @@ typedef struct { PianoSongRating_t rating; } PianoRequestDataAddFeedback_t; -typedef struct { - PianoSong_t *song; - PianoStation_t *from; - PianoStation_t *to; - unsigned short step; -} PianoRequestDataMoveSong_t; - typedef struct { PianoStation_t *station; char *newName; diff --git a/src/libpiano/request.c b/src/libpiano/request.c index 5619e1b..cb1b30a 100644 --- a/src/libpiano/request.c +++ b/src/libpiano/request.c @@ -403,42 +403,6 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, goto cleanup; break; } - - case PIANO_REQUEST_MOVE_SONG: { - /* move song to a different station, needs two requests */ - PianoRequestDataMoveSong_t *reqData = req->data; - PianoRequestDataAddFeedback_t transformedReqData; - - assert (reqData != NULL); - assert (reqData->song != NULL); - assert (reqData->from != NULL); - assert (reqData->to != NULL); - assert (reqData->step < 2); - - transformedReqData.trackToken = reqData->song->trackToken; - req->data = &transformedReqData; - - switch (reqData->step) { - case 0: - transformedReqData.stationId = reqData->from->id; - transformedReqData.rating = PIANO_RATE_BAN; - break; - - case 1: - transformedReqData.stationId = reqData->to->id; - transformedReqData.rating = PIANO_RATE_LOVE; - break; - } - - /* create request data (url, post data) */ - ret = PianoRequest (ph, req, PIANO_REQUEST_ADD_FEEDBACK); - /* and reset request type/data */ - req->type = PIANO_REQUEST_MOVE_SONG; - req->data = reqData; - - goto cleanup; - break; - } } /* standard parameter */ diff --git a/src/libpiano/response.c b/src/libpiano/response.c index 659ed2d..1b63bee 100644 --- a/src/libpiano/response.c +++ b/src/libpiano/response.c @@ -334,21 +334,6 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) { break; } - case PIANO_REQUEST_MOVE_SONG: { - /* move song to different station */ - PianoRequestDataMoveSong_t *reqData = req->data; - - assert (req->responseData != NULL); - assert (reqData != NULL); - assert (reqData->step < 2); - - if (reqData->step == 0) { - ret = PIANO_RET_CONTINUE_REQUEST; - ++reqData->step; - } - break; - } - case PIANO_REQUEST_DELETE_STATION: { /* delete station from server and station list */ PianoStation_t *station = req->data; -- cgit v1.2.3