summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libpiano/piano.h5
-rw-r--r--src/libpiano/request.c10
-rw-r--r--src/ui.c5
-rw-r--r--src/ui_act.c16
4 files changed, 11 insertions, 25 deletions
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index 4ea164d..167f0f9 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -216,11 +216,6 @@ typedef struct {
} PianoRequestDataSearch_t;
typedef struct {
- char *type;
- char *id;
-} PianoRequestDataCreateStation_t;
-
-typedef struct {
PianoStation_t *station;
char *musicId;
} PianoRequestDataAddSeed_t;
diff --git a/src/libpiano/request.c b/src/libpiano/request.c
index 871620d..5619e1b 100644
--- a/src/libpiano/request.c
+++ b/src/libpiano/request.c
@@ -203,15 +203,13 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
}
case PIANO_REQUEST_CREATE_STATION: {
- /* create new station from specified musicid (type=mi, get one by
- * performing a search) or shared station id (type=sh) */
- PianoRequestDataCreateStation_t *reqData = req->data;
+ /* create new station from specified musicToken or station number */
+ char *token = req->data;
- assert (reqData != NULL);
- assert (reqData->id != NULL);
+ assert (token != NULL);
json_object_object_add (j, "musicToken",
- json_object_new_string (reqData->id));
+ json_object_new_string (token));
method = "station.createStation";
break;
diff --git a/src/ui.c b/src/ui.c
index 3f23a23..b1a6407 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -556,7 +556,6 @@ void BarStationFromGenre (BarApp_t *app) {
WaitressReturn_t wRet;
PianoGenreCategory_t *curCat;
PianoGenre_t *curGenre;
- PianoRequestDataCreateStation_t reqData;
int i;
/* receive genre stations list if not yet available */
@@ -613,9 +612,7 @@ void BarStationFromGenre (BarApp_t *app) {
/* create station */
BarUiMsg (&app->settings, MSG_INFO, "Adding shared station \"%s\"... ", curGenre->name);
- reqData.id = curGenre->musicId;
- reqData.type = "mi";
- BarUiPianoCall (app, PIANO_REQUEST_CREATE_STATION, &reqData, &pRet, &wRet);
+ BarUiPianoCall (app, PIANO_REQUEST_CREATE_STATION, curGenre->musicId, &pRet, &wRet);
}
/* replaces format characters (%x) in format string with custom strings
diff --git a/src/ui_act.c b/src/ui_act.c
index 0c9ed1b..ea50ec7 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -147,15 +147,14 @@ BarUiActCallback(BarUiActBanSong) {
BarUiActCallback(BarUiActCreateStation) {
PianoReturn_t pRet;
WaitressReturn_t wRet;
- PianoRequestDataCreateStation_t reqData;
+ char *id = NULL;
- reqData.id = BarUiSelectMusicId (app, NULL,
+ id = BarUiSelectMusicId (app, NULL,
"Create station from artist or title: ");
- if (reqData.id != NULL) {
- reqData.type = "mi";
+ if (id != NULL) {
BarUiMsg (&app->settings, MSG_INFO, "Creating station... ");
- BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, &reqData);
- free (reqData.id);
+ BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, id);
+ free (id);
BarUiActDefaultEventcmd ("stationcreate");
}
}
@@ -165,16 +164,13 @@ BarUiActCallback(BarUiActCreateStation) {
BarUiActCallback(BarUiActAddSharedStation) {
PianoReturn_t pRet;
WaitressReturn_t wRet;
- PianoRequestDataCreateStation_t reqData;
char stationId[50];
BarUiMsg (&app->settings, MSG_QUESTION, "Station id: ");
if (BarReadline (stationId, sizeof (stationId), "0123456789", &app->input,
BAR_RL_DEFAULT, -1) > 0) {
- reqData.id = stationId;
- reqData.type = "sh";
BarUiMsg (&app->settings, MSG_INFO, "Adding shared station... ");
- BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, &reqData);
+ BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, stationId);
BarUiActDefaultEventcmd ("stationaddshared");
}
}