tracker r2494 - in trunk: . src/tracker-extract
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2494 - in trunk: . src/tracker-extract
- Date: Fri, 14 Nov 2008 05:34:00 +0000 (UTC)
Author: mottela
Date: Fri Nov 14 05:34:00 2008
New Revision: 2494
URL: http://svn.gnome.org/viewvc/tracker?rev=2494&view=rev
Log:
Stripped filename used as the default title
Modified:
trunk/ChangeLog
trunk/src/tracker-extract/tracker-extract-gstreamer.c
trunk/src/tracker-extract/tracker-extract-mp3.c
Modified: trunk/src/tracker-extract/tracker-extract-gstreamer.c
==============================================================================
--- trunk/src/tracker-extract/tracker-extract-gstreamer.c (original)
+++ trunk/src/tracker-extract/tracker-extract-gstreamer.c Fri Nov 14 05:34:00 2008
@@ -890,11 +890,23 @@
#endif /* HAVE_GDKPIXBUF */
}
- /* Check that we have the minimum data. FIXME We should not need to do this */
+ /* Check that we have the minimum data. FIXME We should not need to do this FIXME We only take the part before first .*/
if (type==EXTRACT_MIME_AUDIO) {
if (!g_hash_table_lookup (metadata, "Audio:Title")) {
- g_hash_table_insert (metadata, g_strdup ("Audio:Title"), g_strdup ("tracker:unknown"));
+ gchar *basename = g_filename_display_basename(uri);
+ gchar **parts = g_strsplit (basename, ".", -1);
+ gchar *title = g_strdup(parts[0]);
+
+ g_strfreev (parts);
+ g_free (basename);
+
+ title = g_strdelimit (title, "_", ' ');
+ title = g_strstrip (title);
+
+ g_hash_table_insert (metadata,
+ g_strdup ("Audio:Title"),
+ title);
}
if (!g_hash_table_lookup (metadata, "Audio:Album")) {
@@ -918,7 +930,19 @@
}
} else if (type==EXTRACT_MIME_VIDEO) {
if (!g_hash_table_lookup (metadata, "Video:Title")) {
- g_hash_table_insert (metadata, g_strdup ("Video:Title"), g_strdup ("tracker:unknown"));
+ gchar *basename = g_filename_display_basename(uri);
+ gchar **parts = g_strsplit (basename, ".", -1);
+ gchar *title = g_strdup(parts[0]);
+
+ g_strfreev (parts);
+ g_free (basename);
+
+ title = g_strdelimit (title, "_", ' ');
+ title = g_strstrip (title);
+
+ g_hash_table_insert (metadata,
+ g_strdup ("Video:Title"),
+ title);
}
if (!g_hash_table_lookup (metadata, "Video:Author")) {
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 Fri Nov 14 05:34:00 2008
@@ -1303,9 +1303,19 @@
/* Check that we have the minimum data. FIXME We should not need to do this */
if (!g_hash_table_lookup (metadata, "Audio:Title")) {
+ gchar *basename = g_filename_display_basename(filename);
+ gchar **parts = g_strsplit (basename, ".", -1);
+ gchar *title = g_strdup(parts[0]);
+
+ g_strfreev (parts);
+ g_free (basename);
+
+ title = g_strdelimit (title, "_", ' ');
+ title = g_strstrip (title);
+
g_hash_table_insert (metadata,
g_strdup ("Audio:Title"),
- g_strdup ("tracker:unknown"));
+ title);
}
if (!g_hash_table_lookup (metadata, "Audio:Album")) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]