summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2013-03-20 13:37:46 +0100
committerLars-Dominik Braun <lars@6xq.net>2013-03-20 13:37:46 +0100
commit5e17cd1109f9705925742254fcc2be083603be39 (patch)
tree129d9f46f984f9f5c2801db60e153871cdcdb922 /src
parent2c516503d2cb81dd156afc24677ac4bf3caefceb (diff)
downloadpianobar-windows-5e17cd1109f9705925742254fcc2be083603be39.tar.gz
pianobar-windows-5e17cd1109f9705925742254fcc2be083603be39.tar.bz2
pianobar-windows-5e17cd1109f9705925742254fcc2be083603be39.zip
Transform actual station when loving/banning songs
Loving/banning a song from a shared station while playing quickmix resulted in “call not allowed”, because we tried to transform the quickmix instead of the song’s real station. Fixes #354.
Diffstat (limited to 'src')
-rw-r--r--src/ui_act.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index 8d9ac09..33d9edb 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -122,11 +122,18 @@ BarUiActCallback(BarUiActAddMusic) {
BarUiActCallback(BarUiActBanSong) {
PianoReturn_t pRet;
WaitressReturn_t wRet;
+ PianoStation_t *realStation;
assert (selStation != NULL);
assert (selSong != NULL);
+ assert (selSong->stationId != NULL);
- if (!BarTransformIfShared (app, selStation)) {
+ if ((realStation = PianoFindStationById (app->ph.stations,
+ selSong->stationId)) == NULL) {
+ assert (0);
+ return;
+ }
+ if (!BarTransformIfShared (app, realStation)) {
return;
}
@@ -312,11 +319,18 @@ BarUiActCallback(BarUiActDebug) {
BarUiActCallback(BarUiActLoveSong) {
PianoReturn_t pRet;
WaitressReturn_t wRet;
+ PianoStation_t *realStation;
assert (selStation != NULL);
assert (selSong != NULL);
+ assert (selSong->stationId != NULL);
- if (!BarTransformIfShared (app, selStation)) {
+ if ((realStation = PianoFindStationById (app->ph.stations,
+ selSong->stationId)) == NULL) {
+ assert (0);
+ return;
+ }
+ if (!BarTransformIfShared (app, realStation)) {
return;
}