Commit f02eb688 authored by Mikael Ottela's avatar Mikael Ottela

Remove the dummy empty strings for unknown values as they are no longer needed

svn path=/trunk/; revision=3046
parent 25dbae89
2009-03-10 Mikael Ottela <mikael.ottela@ixonos.com>
* src/tracker-extract/tracker-main.h
* src/tracker-extract/tracker-extract-gstreamer-helix.c
* src/tracker-extract/tracker-extract-mp3.c: Remove the last dummy
empty strings as they are no longer needed.
2009-03-10 Mikael Ottela <mikael.ottela@ixonos.com>
* data/services/default.service
......
......@@ -827,37 +827,52 @@ tracker_extract_gstreamer_helix (const gchar *uri,
/* Check that we have the minimum data. FIXME We should not need to do this */
if (type==EXTRACT_MIME_AUDIO) {
if (!g_hash_table_lookup (metadata, "Audio:Title")) {
g_hash_table_insert (metadata, g_strdup ("Audio:Title"), g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:Album")) {
g_hash_table_insert (metadata, g_strdup ("Audio:Album"), g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:Artist")) {
g_hash_table_insert (metadata, g_strdup ("Audio:Artist"), g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:Genre")) {
g_hash_table_insert (metadata, g_strdup ("Audio:Genre"), g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:PlayCount")) {
g_hash_table_insert (metadata, g_strdup ("Audio:PlayCount"), g_strdup ("0"));
if (type == EXTRACT_MIME_IMAGE) {
if (!g_hash_table_lookup (metadata, "Image:Date")) {
struct stat st;
if (g_lstat (uri, &st) >= 0) {
gchar *date;
date = tracker_date_to_string (st.st_mtime);
g_hash_table_insert (metadata,
g_strdup ("Image:Date"),
tracker_escape_metadata (date));
g_free (date);
}
}
} else if (type==EXTRACT_MIME_VIDEO) {
} 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 (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Video:Author")) {
g_hash_table_insert (metadata, g_strdup ("Video:Author"), g_strdup (METADATA_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);
if (!g_hash_table_lookup (metadata, "Video:PlayCount")) {
g_hash_table_insert (metadata, g_strdup ("Video:PlayCount"), g_strdup ("0"));
title = g_strdelimit (title, "_", ' ');
g_hash_table_insert (metadata,
g_strdup ("Video:Title"),
tracker_escape_metadata (title));
g_free (title);
}
} else if (type == EXTRACT_MIME_AUDIO) {
if (!g_hash_table_lookup (metadata, "Audio:Title")) {
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, "_", ' ');
g_hash_table_insert (metadata,
g_strdup ("Audio:Title"),
tracker_escape_metadata (title));
g_free (title);
}
}
......
......@@ -1619,37 +1619,6 @@ extract_mp3 (const gchar *filename,
g_free (title);
}
if (!g_hash_table_lookup (metadata, "Audio:Album")) {
g_hash_table_insert (metadata,
g_strdup ("Audio:Album"),
g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:Artist")) {
g_hash_table_insert (metadata,
g_strdup ("Audio:Artist"),
g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:Genre")) {
g_hash_table_insert (metadata,
g_strdup ("Audio:Genre"),
g_strdup (METADATA_UNKNOWN));
}
if (!g_hash_table_lookup (metadata, "Audio:PlayCount")) {
g_hash_table_insert (metadata,
g_strdup ("Audio:PlayCount"),
g_strdup ("0"));
}
if (!g_hash_table_lookup (metadata, "Audio:Duration")) {
g_hash_table_insert (metadata,
g_strdup ("Audio:Duration"),
g_strdup ("0"));
}
#ifndef G_OS_WIN32
munmap (buffer, size);
#endif
......
......@@ -28,13 +28,6 @@
G_BEGIN_DECLS
/* FIXME: We use this to say that we don't actually have any metadata
* for this keyword. This is bad because it means we have to string
* check every value returned in clients that use the Tracker API.
* This will be fixed in due course after January some time, -mr.
*/
#define METADATA_UNKNOWN ""
typedef struct TrackerExtractData TrackerExtractData;
typedef TrackerExtractData * (*TrackerExtractDataFunc)(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment