[Nautilus-list] [PATCH] make the music-view show song info correctly



hi

	here is my latest fix for this.

Diego


Index: components/music/nautilus-music-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/music/nautilus-music-view.c,v
retrieving revision 1.166
diff -u -r1.166 nautilus-music-view.c
--- components/music/nautilus-music-view.c	7 Mar 2002 19:35:45 -0000	1.166
+++ components/music/nautilus-music-view.c	11 Mar 2002 15:34:03 -0000
@@ -886,11 +886,28 @@
 	}
 	
 	/* Copy data from tag into our info struct */
-	song_info->title = g_strdup (tag.title);
-	song_info->artist = g_strdup (tag.artist);
-	song_info->album = g_strdup (tag.album); 
-        song_info->year = filter_out_unset_year (tag.year);
-	song_info->comment = g_strdup (tag.comment);
+	if (!g_utf8_validate (tag.title, -1, NULL)) {
+		song_info->title = g_convert (tag.title, -1, "UTF8", "ISO-8859-1", NULL, NULL, NULL);
+	} else {
+		song_info->title = g_strdup (tag.title);
+	}
+	if (!g_utf8_validate (tag.album, -1, NULL)) {
+		song_info->album = g_convert (tag.album, -1, "UTF8", "ISO-8859-1", NULL, NULL, NULL);
+	} else {
+		song_info->album = g_strdup (tag.album);
+	}
+	if (!g_utf8_validate (tag.artist, -1, NULL)) {
+		song_info->artist = g_convert (tag.artist, -1, "UTF8", "ISO-8859-1", NULL, NULL, NULL);
+	} else {
+		song_info->artist = g_strdup (tag.artist);
+	}
+	if (!g_utf8_validate (tag.comment, -1, NULL)) {
+		song_info->comment = g_convert (tag.comment, -1, "UTF8", "ISO-8859-1", NULL, NULL, NULL);
+	} else {
+		song_info->comment = g_strdup (tag.comment);
+	}
+
+	song_info->year = filter_out_unset_year (tag.year);
 	song_info->track_number = atoi (tag.track);
 
 	/* Clean up */
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5121
diff -u -r1.5121 ChangeLog
--- ChangeLog	10 Mar 2002 05:23:57 -0000	1.5121
+++ ChangeLog	11 Mar 2002 15:34:08 -0000
@@ -1,3 +1,8 @@
+2002-03-10  Diego González  <dggonz yahoo com>
+
+	* components/music/nautilus-music-vew.c (read_id_tag): convert
+	title, comments, artist and album to UTF-8
+
 2002-03-10  Alexander Larsson  <alla lysator liu se>
 
 	* src/nautilus-property-browser.c (element_clicked_callback):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]