diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-05-02 17:33:12 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-05-02 17:33:32 +0200 |
commit | 22e725f545548e6b9583644987e82cb1e3b7ae1f (patch) | |
tree | ea45e621f7349ceef9081ab163c11f79265b4d78 /src/ui.c | |
parent | 951d6206f2837d5985899c5b974690e0076b68c5 (diff) | |
download | pianobar-22e725f545548e6b9583644987e82cb1e3b7ae1f.tar.gz pianobar-22e725f545548e6b9583644987e82cb1e3b7ae1f.tar.bz2 pianobar-22e725f545548e6b9583644987e82cb1e3b7ae1f.zip |
Really delete seed suggestions
There does not seem to be an API call for that.
Diffstat (limited to 'src/ui.c')
-rw-r--r-- | src/ui.c | 39 |
1 files changed, 11 insertions, 28 deletions
@@ -485,7 +485,7 @@ PianoArtist_t *BarUiSelectArtist (BarApp_t *app, PianoArtist_t *startArtist) { * @return musicId or NULL on abort/error */ char *BarUiSelectMusicId (BarApp_t *app, PianoStation_t *station, - PianoSong_t *similarSong, const char *msg) { + const char *msg) { char *musicId = NULL; char lineBuf[100], selectBuf[2]; PianoSearchResult_t searchResult; @@ -495,36 +495,19 @@ char *BarUiSelectMusicId (BarApp_t *app, PianoStation_t *station, BarUiMsg (&app->settings, MSG_QUESTION, msg); if (BarReadlineStr (lineBuf, sizeof (lineBuf), &app->input, BAR_RL_DEFAULT) > 0) { - if (strcmp ("?", lineBuf) == 0 && station != NULL && - similarSong != NULL) { - PianoReturn_t pRet; - WaitressReturn_t wRet; - PianoRequestDataGetSeedSuggestions_t reqData; - - reqData.station = station; - reqData.musicId = similarSong->musicId; - reqData.max = 20; - - BarUiMsg (&app->settings, MSG_INFO, "Receiving suggestions... "); - if (!BarUiPianoCall (app, PIANO_REQUEST_GET_SEED_SUGGESTIONS, - &reqData, &pRet, &wRet)) { - return NULL; - } - memcpy (&searchResult, &reqData.searchResult, sizeof (searchResult)); - } else { - PianoReturn_t pRet; - WaitressReturn_t wRet; - PianoRequestDataSearch_t reqData; + PianoReturn_t pRet; + WaitressReturn_t wRet; + PianoRequestDataSearch_t reqData; - reqData.searchStr = lineBuf; + reqData.searchStr = lineBuf; - BarUiMsg (&app->settings, MSG_INFO, "Searching... "); - if (!BarUiPianoCall (app, PIANO_REQUEST_SEARCH, &reqData, &pRet, - &wRet)) { - return NULL; - } - memcpy (&searchResult, &reqData.searchResult, sizeof (searchResult)); + BarUiMsg (&app->settings, MSG_INFO, "Searching... "); + if (!BarUiPianoCall (app, PIANO_REQUEST_SEARCH, &reqData, &pRet, + &wRet)) { + return NULL; } + memcpy (&searchResult, &reqData.searchResult, sizeof (searchResult)); + BarUiMsg (&app->settings, MSG_NONE, "\r"); if (searchResult.songs != NULL && searchResult.artists != NULL) { |