From 941d4f27ef5337c5be5553f93e41aed7745c71e1 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <PromyLOPh@gmail.com>
Date: Tue, 10 Jun 2008 11:11:14 +0200
Subject: Return success/error in PianoRateTrack

---
 src/main.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/main.c b/src/main.c
index 12aa8a3..e8c15c9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -283,17 +283,23 @@ int main (int argc, char **argv) {
 
 					case 'b':
 						player.doQuit = 1;
-						PianoRateTrack (&ph, curStation, curSong,
-								PIANO_RATE_BAN);
-						printf ("Banned.\n");
+						if (PianoRateTrack (&ph, curStation, curSong,
+								PIANO_RATE_BAN) == PIANO_RET_OK) {
+							printf ("Banned.\n");
+						} else {
+							printf ("Error while banning track.\n");
+						}
 						/* pandora does this too, I think */
 						PianoDestroyPlaylist (&ph);
 						break;
 
 					case 'l':
-						PianoRateTrack (&ph, curStation, curSong,
-								PIANO_RATE_LOVE);
-						printf ("Loved.\n");
+						if (PianoRateTrack (&ph, curStation, curSong,
+								PIANO_RATE_LOVE) == PIANO_RET_OK) {
+							printf ("Loved.\n");
+						} else {
+							printf ("Error while loving track.\n");
+						}
 						break;
 
 					case 'n':
-- 
cgit v1.2.3