[tracker/tracker-0.6] Fixes NB#135368, No Track Number in itunes audio books



commit 2ca927063ba37bfd10ed59eed1c36096609b46f9
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Fri Oct 9 12:56:05 2009 +0300

    Fixes NB#135368, No Track Number in itunes audio books
    
    Get the track number also from the first versions of id3.

 src/tracker-extract/tracker-extract-mp3.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 75fb504..6af7f18 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -1548,6 +1548,7 @@ get_id3v20_tags (const gchar *data,
 		{ "COM", "Audio:Comment" },
 #endif /* ENABLE_DETAILED_METADATA */
 		{ "TLE", "Audio:Duration" },
+		{ "TRK", "Audio:TrackNo" },
 		{ NULL, 0 },
 	};
 
@@ -1643,8 +1644,15 @@ get_id3v20_tags (const gchar *data,
 						g_free (word);
 						word = g_strdup_printf ("%d", duration/1000);
 						filedata->duration = duration/1000;
-					}	
-					
+					} else if (strcmp (tmap[i].text, "TRK") == 0) {
+						gchar **parts;
+
+						parts = g_strsplit (word, "/", 2);
+						g_free (word);
+
+						word = g_strdup (parts[0]);
+						g_strfreev (parts);
+					}
 					g_hash_table_insert (metadata,
 							     g_strdup (tmap[i].type),
 							     tracker_escape_metadata (word));



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