From 3116926fefa426e0663f4caee06819163d8a6b82 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <PromyLOPh@gmail.com>
Date: Wed, 16 Jul 2008 21:12:54 +0200
Subject: Support rating of songs played by QuickMix

Attention! This breaks libpiano's api compatibility because of a changed
argument count in PianoRateTrack
---
 libpiano/src/main.c  | 7 +++----
 libpiano/src/piano.h | 4 ++--
 src/main.c           | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/libpiano/src/main.c b/libpiano/src/main.c
index 5ac5964..4cd3aa3 100644
--- a/libpiano/src/main.c
+++ b/libpiano/src/main.c
@@ -297,15 +297,14 @@ PianoReturn_t PianoGetPlaylist (PianoHandle_t *ph, char *stationId) {
  *	not allowed)
  *	@public yes
  *	@param piano handle
- *	@param track will be added to this stations loved tracks list
  *	@param rate this track
  *	@param your rating
  */
-PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
-		PianoSong_t *song, PianoSongRating_t rating) {
+PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoSong_t *song,
+		PianoSongRating_t rating) {
 	PianoReturn_t ret;
 
-	ret = PianoAddFeedback (ph, station->id, song->musicId,
+	ret = PianoAddFeedback (ph, song->stationId, song->musicId,
 			song->matchingSeed, song->userSeed, song->focusTraitId, rating);
 
 	if (ret == PIANO_RET_OK) {
diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h
index 9945839..3d909f8 100644
--- a/libpiano/src/piano.h
+++ b/libpiano/src/piano.h
@@ -157,8 +157,8 @@ PianoReturn_t PianoConnect (PianoHandle_t *ph, char *user, char *password,
 PianoReturn_t PianoGetStations (PianoHandle_t *ph);
 PianoReturn_t PianoGetPlaylist (PianoHandle_t *ph, char *stationId);
 
-PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
-		PianoSong_t *song, PianoSongRating_t rating);
+PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoSong_t *song,
+		PianoSongRating_t rating);
 PianoReturn_t PianoMoveSong (PianoHandle_t *ph, PianoStation_t *stationFrom,
 		PianoStation_t *stationTo, PianoSong_t *song);
 PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station,
diff --git a/src/main.c b/src/main.c
index fb9e02d..14091ca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -418,7 +418,7 @@ int main (int argc, char **argv) {
 						break;
 					}
 					BarUiMsg ("Banning song... ");
-					if (PianoRateTrack (&ph, curStation, curSong,
+					if (PianoRateTrack (&ph, curSong,
 							PIANO_RATE_BAN) == PIANO_RET_OK) {
 						BarUiMsg ("Ok.\n");
 						player.doQuit = 1;
@@ -476,7 +476,7 @@ int main (int argc, char **argv) {
 						break;
 					}
 					BarUiMsg ("Loving song... ");
-					if (PianoRateTrack (&ph, curStation, curSong,
+					if (PianoRateTrack (&ph, curSong,
 							PIANO_RATE_LOVE) == PIANO_RET_OK) {
 						BarUiMsg ("Ok.\n");
 					} else {
-- 
cgit v1.2.3