summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-07-22 17:22:27 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-07-22 17:22:27 +0200
commitbfbb8e26d6b89cef9d496246f0f6a64e3f3eafb5 (patch)
treede1a15c1327d89a319382a3074e0fd8905ba7d58
parent9f0655556d93b2e237f3e94af8b27d4bbc0940c5 (diff)
downloadpianobar-bfbb8e26d6b89cef9d496246f0f6a64e3f3eafb5.tar.gz
pianobar-bfbb8e26d6b89cef9d496246f0f6a64e3f3eafb5.tar.bz2
pianobar-bfbb8e26d6b89cef9d496246f0f6a64e3f3eafb5.zip
Show error message when receiving a new playlist failed
... instead of showing "No tracks left."
-rw-r--r--src/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 56d921f..90c3feb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -404,13 +404,17 @@ int main (int argc, char **argv) {
if (curSong == NULL) {
BarUiMsg ("Receiving new playlist... ");
PianoDestroyPlaylist (&ph);
- PianoGetPlaylist (&ph, curStation->id);
- curSong = ph.playlist;
- if (curSong == NULL) {
- BarUiMsg ("No tracks left.\n");
- curStation = NULL;
+ if (PianoGetPlaylist (&ph, curStation->id) !=
+ PIANO_RET_OK) {
+ BarUiMsg ("Error.\n");
} else {
- BarUiMsg ("Ok.\n");
+ curSong = ph.playlist;
+ if (curSong == NULL) {
+ BarUiMsg ("No tracks left.\n");
+ curStation = NULL;
+ } else {
+ BarUiMsg ("Ok.\n");
+ }
}
}
if (curSong != NULL) {