diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2011-10-22 16:34:48 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-10-22 16:34:48 +0200 |
commit | ba60fbc4274e85fb63d373207f525aa57bc75eb3 (patch) | |
tree | a8ccff14797158942c72f4fbbbf8e37cd8377fbd /src/libpiano/piano.c | |
parent | 55d6eb4c91a994bc83560a27296329a6ce0d2329 (diff) | |
download | pianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.tar.gz pianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.tar.bz2 pianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.zip |
Support seed stations
Fixes #165
Diffstat (limited to 'src/libpiano/piano.c')
-rw-r--r-- | src/libpiano/piano.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c index d6071f2..9a7e8d3 100644 --- a/src/libpiano/piano.c +++ b/src/libpiano/piano.c @@ -91,6 +91,7 @@ void PianoDestroySearchResult (PianoSearchResult_t *searchResult) { void PianoDestroyStation (PianoStation_t *station) { free (station->name); free (station->id); + free (station->seedId); memset (station, 0, sizeof (station)); } @@ -141,6 +142,7 @@ void PianoDestroyStationInfo (PianoStationInfo_t *info) { PianoDestroyPlaylist (info->feedback); PianoDestroyPlaylist (info->songSeeds); PianoDestroyArtists (info->artistSeeds); + PianoDestroyStations (info->stationSeeds); } /* destroy genre linked list @@ -769,12 +771,15 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, char *seedId = NULL; assert (reqData != NULL); - assert (reqData->song != NULL || reqData->artist != NULL); + assert (reqData->song != NULL || reqData->artist != NULL || + reqData->station != NULL); if (reqData->song != NULL) { seedId = reqData->song->seedId; } else if (reqData->artist != NULL) { seedId = reqData->artist->seedId; + } else if (reqData->station != NULL) { + seedId = reqData->station->seedId; } assert (seedId != NULL); |