tracker r2430 - in trunk: . src/tracker-extract



Author: mottela
Date: Wed Oct 29 16:31:39 2008
New Revision: 2430
URL: http://svn.gnome.org/viewvc/tracker?rev=2430&view=rev

Log:
Fixes to mp3 extraction for genre and original artist

Modified:
   trunk/ChangeLog
   trunk/src/tracker-extract/tracker-extract-mp3.c

Modified: trunk/src/tracker-extract/tracker-extract-mp3.c
==============================================================================
--- trunk/src/tracker-extract/tracker-extract-mp3.c	(original)
+++ trunk/src/tracker-extract/tracker-extract-mp3.c	Wed Oct 29 16:31:39 2008
@@ -528,7 +528,7 @@
 		{"TPE1", "Audio:Artist"},
 		{"TPE2", "Audio:Artist"},
 		{"TPE3", "Audio:Performer"},
-		{"TOPE", "Audio:Artist"},
+		/*	{"TOPE", "Audio:Artist"}, We dont' want the original artist for now */
 		{"TPUB", "DC:Publishers"},
 		{"TOAL", "Audio:Album"},
 		{"TALB", "Audio:Album"},
@@ -666,6 +666,21 @@
 						word = s;
 					}
 
+					/* Genre to text */
+					if ((strcmp (tmap[i].text, "TCON") == 0) ||
+					    (strcmp (tmap[i].text, "TIT1") == 0)) {
+						guint genre;
+
+						genre = strtoul (word, NULL, 10);
+						if ((guint) genre < G_N_ELEMENTS (genre_names)) {
+							gchar *s;
+						
+							s = g_strdup (genre_names[genre]);
+							g_free (word);
+							word = s;
+						}
+					}
+
 					g_hash_table_insert (metadata,
 							     g_strdup (tmap[i].type),
 							     g_strdup (word));
@@ -731,7 +746,7 @@
 		{"TPE2", "Audio:Artist"},
 		{"TPE3", "Audio:Performer"},
 		{"TIME", "Audio:ReleaseDate"},
-		{"TOPE", "Audio:Artist"},
+		/*	{"TOPE", "Audio:Artist"}, We don't want the original artist for now */
 		{"TPUB", "DC:Publishers"},
 		{"TOAL", "Audio:Album"},
 		{"TALB", "Audio:Album"},
@@ -868,6 +883,21 @@
 						word = s;
 					}
 
+					/* Genre to text */
+					if ((strcmp (tmap[i].text, "TCON") == 0) ||
+					    (strcmp (tmap[i].text, "TIT1") == 0)) {
+						guint genre;
+
+						genre = strtoul (word, NULL, 10);
+						if ((guint) genre < G_N_ELEMENTS (genre_names)) {
+							gchar *s;
+						
+							s = g_strdup (genre_names[genre]);
+							g_free (word);
+							word = s;
+						}
+					}
+
 					g_hash_table_insert (metadata,
 							     g_strdup (tmap[i].type),
 							     g_strdup (word));



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