Permalink
Browse files

Handle album when generating the notification message

  • Loading branch information...
rossburton committed Oct 13, 2008
1 parent a9a095e commit acd7da4c5b8e2647697aa7c80d4b0157989ec58b
Showing with 12 additions and 5 deletions.
  1. +12 −5 tracknotify.c
View
@@ -46,15 +46,22 @@ notify (DIDL *didl)
NotifyNotification *notify;
char *message;
- if (didl->title && didl->artist)
+ if (didl->title && didl->artist && didl->album)
+ message = g_markup_printf_escaped ("Playing %s by %s from %s", didl->title, didl->artist, didl->album);
+ else if (didl->title && didl->artist)
message = g_markup_printf_escaped ("Playing %s by %s", didl->title, didl->artist);
- else if (didl->title && !didl->artist)
+ else if (didl->title)
message = g_markup_printf_escaped ("Playing %s", didl->title);
- else if (!didl->title && didl->artist)
+ else if (didl->artist)
message = g_markup_printf_escaped ("Playing %s", didl->artist);
- else
+ else if (didl->album)
+ message = g_markup_printf_escaped ("Playing %s", didl->album);
+ else {
+ g_warning ("TODO: unhandled combination %p %p %p",
+ didl->title, didl->artist, didl->album);
return;
-
+ }
+
/* TODO: if the notify is already on screen, change it */
notify = notify_notification_new (message, NULL,

0 comments on commit acd7da4

Please sign in to comment.