changeset 1600:047c8b32c251 trunk

[svn] - Streamtitles are fun.
author nhjm449
date Sat, 26 Aug 2006 21:47:26 -0700
parents 825be2235f8c
children 54a210b20190
files ChangeLog Plugins/General/notify/notify.c
diffstat 2 files changed, 27 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Aug 26 21:36:50 2006 -0700
+++ b/ChangeLog	Sat Aug 26 21:47:26 2006 -0700
@@ -1,3 +1,12 @@
+2006-08-27 04:36:50 +0000  George Averill <nhjm449@gmail.com>
+  revision [2129]
+  - Don't save empty lengths.
+  
+
+  Changes:        Modified:
+  +1 -1           trunk/Plugins/Container/xspf/xspf.c  
+
+
 2006-08-27 04:21:35 +0000  George Averill <nhjm449@gmail.com>
   revision [2127]
   - Tracks with unknown lengths shouldn't be considered 0 seconds long! :P
--- a/Plugins/General/notify/notify.c	Sat Aug 26 21:36:50 2006 -0700
+++ b/Plugins/General/notify/notify.c	Sat Aug 26 21:47:26 2006 -0700
@@ -114,7 +114,7 @@
 		g_strcasecmp(title, previous_title)) ||
 		(title == NULL && pos != notify_playlist_pos) || (! was_playing)))
 	{
-		gchar *tmpbuf, *filename;
+		gchar *tmpbuf, *filename, *songtitle;
 		TitleInput *tuple;
 
 		tuple = playlist_get_tuple(pos);
@@ -122,19 +122,25 @@
 		if (tuple == NULL)
 			return TRUE;
 
-		filename = playlist_get_filename(pos);
+		if (tuple->performer || tuple->album_name || tuple->track_name) {
+			filename = playlist_get_filename(pos);
 
-		tmpbuf = g_markup_printf_escaped("<b>%s</b>\n<i>%s</i>\n%s",
-			(tuple->performer ? tuple->performer : ( audcfg.notif_skipnf == FALSE ? _("Unknown Artist") : "" )),
-			(tuple->album_name ? tuple->album_name : ( audcfg.notif_skipnf == FALSE ? _("Unknown Album") : "" )),
-			(tuple->track_name ?
-				tuple->track_name :
-				(filename ?
-					(strrchr(filename, '/') ? (strrchr(filename, '/') + 1) : filename) :
-					_("Unknown Track")
+			tmpbuf = g_markup_printf_escaped("<b>%s</b>\n<i>%s</i>\n%s",
+				(tuple->performer ? tuple->performer : ( audcfg.notif_skipnf == FALSE ? _("Unknown Artist") : "" )),
+				(tuple->album_name ? tuple->album_name : ( audcfg.notif_skipnf == FALSE ? _("Unknown Album") : "" )),
+				(tuple->track_name ?
+					tuple->track_name :
+					(filename ?
+						(strrchr(filename, '/') ? (strrchr(filename, '/') + 1) : filename) :
+						_("Unknown Track")
+					)
 				)
-			)
-		);
+			);
+		} else {
+			songtitle = playlist_get_songtitle(pos);
+
+			tmpbuf = g_markup_printf_escaped("%s", (songtitle ? songtitle : _("Unknown Track")));
+		}
 
 		do_notification("Audacious", tmpbuf, DATA_DIR "/pixmaps/audacious.png");
 		g_free(tmpbuf);