[tracker/guarantee] libtracker-extract: Rename *from_filename* to *from_file*
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/guarantee] libtracker-extract: Rename *from_filename* to *from_file*
- Date: Wed, 15 Dec 2010 09:32:49 +0000 (UTC)
commit a7d1ea5d0d716c615c3beb055138cdc9d8736db9
Author: Martyn Russell <martyn lanedo com>
Date: Wed Dec 15 09:32:29 2010 +0000
libtracker-extract: Rename *from_filename* to *from_file*
For the Guarantee API
src/libtracker-extract/tracker-guarantee.c | 36 ++++++++++++----------
src/libtracker-extract/tracker-guarantee.h | 16 +++++-----
src/tracker-extract/tracker-extract-flac.c | 4 +-
src/tracker-extract/tracker-extract-gif.c | 16 +++++-----
src/tracker-extract/tracker-extract-gupnp-dlna.c | 16 +++++-----
src/tracker-extract/tracker-extract-jpeg.c | 16 +++++-----
src/tracker-extract/tracker-extract-mp3.c | 16 +++++-----
src/tracker-extract/tracker-extract-png.c | 16 +++++-----
src/tracker-extract/tracker-extract-tiff.c | 16 +++++-----
9 files changed, 78 insertions(+), 74 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-guarantee.c b/src/libtracker-extract/tracker-guarantee.c
index c3982d5..053a9a2 100644
--- a/src/libtracker-extract/tracker-guarantee.c
+++ b/src/libtracker-extract/tracker-guarantee.c
@@ -27,8 +27,10 @@
#include "tracker-guarantee.h"
+#ifdef GUARANTEE_METADATA
+
static gchar *
-get_title_from_filename (const gchar *uri)
+get_title_from_file (const gchar *uri)
{
gchar *filename;
gchar *basename;
@@ -47,7 +49,7 @@ get_title_from_filename (const gchar *uri)
}
static gchar *
-get_date_from_filename_mtime (const gchar *uri)
+get_date_from_file_mtime (const gchar *uri)
{
gchar *filename;
gchar *date;
@@ -62,8 +64,10 @@ get_date_from_filename_mtime (const gchar *uri)
return date;
}
+#endif /* GUARANTEE_METADATA */
+
/**
- * tracker_guarantee_title_from_filename:
+ * tracker_guarantee_title_from_file:
* @metadata: the metadata object to insert the data into
* @key: the key to insert into @metadata
* @current_value: the current data to check before looking at @uri
@@ -73,7 +77,7 @@ get_date_from_filename_mtime (const gchar *uri)
* empty string). If it is, then @uri is parsed to guarantee a
* metadata value for @key.
*
- * Parses the filename pointed to by @uri and uses the basename
+ * Parses the file pointed to by @uri and uses the basename
* (before the "." and extension of the file) as the title. If the
* title has any "_" characters, they are also converted into spaces.
*
@@ -82,10 +86,10 @@ get_date_from_filename_mtime (const gchar *uri)
* Since: 0.10
**/
gboolean
-tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
- const gchar *key,
- const gchar *current_value,
- const gchar *uri)
+tracker_guarantee_title_from_file (TrackerSparqlBuilder *metadata,
+ const gchar *key,
+ const gchar *current_value,
+ const gchar *uri)
{
#ifdef GUARANTEE_METADATA
g_return_val_if_fail (metadata != NULL, FALSE);
@@ -99,7 +103,7 @@ tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
} else {
gchar *value;
- value = get_title_from_filename (uri);
+ value = get_title_from_file (uri);
tracker_sparql_builder_object_unvalidated (metadata, value);
g_free (value);
}
@@ -114,7 +118,7 @@ tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
}
/**
- * tracker_guarantee_date_from_filename_mtime:
+ * tracker_guarantee_date_from_file_mtime:
* @metadata: the metadata object to insert the data into
* @key: the key to insert into @metadata
* @current_value: the current data to check before looking at @uri
@@ -124,7 +128,7 @@ tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
* empty string). If it is, then @uri is parsed to guarantee a
* metadata value for @key.
*
- * When parsing @uri, stat() is called on the filename to create a
+ * When parsing @uri, stat() is called on the file to create a
* date based on the file's mtime.
*
* Returns: %TRUE on success, otherwise %FALSE.
@@ -132,10 +136,10 @@ tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
* Since: 0.10
**/
gboolean
-tracker_guarantee_date_from_filename_mtime (TrackerSparqlBuilder *metadata,
- const gchar *key,
- const gchar *current_value,
- const gchar *uri)
+tracker_guarantee_date_from_file_mtime (TrackerSparqlBuilder *metadata,
+ const gchar *key,
+ const gchar *current_value,
+ const gchar *uri)
{
#ifdef GUARANTEE_METADATA
g_return_val_if_fail (metadata != NULL, FALSE);
@@ -149,7 +153,7 @@ tracker_guarantee_date_from_filename_mtime (TrackerSparqlBuilder *metadata,
} else {
gchar *value;
- value = get_date_from_filename_mtime (uri);
+ value = get_date_from_file_mtime (uri);
tracker_sparql_builder_object_unvalidated (metadata, value);
g_free (value);
}
diff --git a/src/libtracker-extract/tracker-guarantee.h b/src/libtracker-extract/tracker-guarantee.h
index d662f62..bbf4878 100644
--- a/src/libtracker-extract/tracker-guarantee.h
+++ b/src/libtracker-extract/tracker-guarantee.h
@@ -30,14 +30,14 @@
G_BEGIN_DECLS
-gboolean tracker_guarantee_title_from_filename (TrackerSparqlBuilder *metadata,
- const gchar *key,
- const gchar *current_value,
- const gchar *uri);
-gboolean tracker_guarantee_date_from_filename_mtime (TrackerSparqlBuilder *metadata,
- const gchar *key,
- const gchar *current_value,
- const gchar *uri);
+gboolean tracker_guarantee_title_from_file (TrackerSparqlBuilder *metadata,
+ const gchar *key,
+ const gchar *current_value,
+ const gchar *uri);
+gboolean tracker_guarantee_date_from_file_mtime (TrackerSparqlBuilder *metadata,
+ const gchar *key,
+ const gchar *current_value,
+ const gchar *uri);
G_END_DECLS
diff --git a/src/tracker-extract/tracker-extract-flac.c b/src/tracker-extract/tracker-extract-flac.c
index a60d179..d3f1ff8 100644
--- a/src/tracker-extract/tracker-extract-flac.c
+++ b/src/tracker-extract/tracker-extract-flac.c
@@ -323,7 +323,7 @@ extract_flac (const gchar *uri,
add_tuple (metadata, "nmm:musicAlbum", album_uri);
g_free (album_uri);
- tracker_guarantee_title_from_filename (metadata, "nie:title", fd.title, uri);
+ tracker_guarantee_title_from_file (metadata, "nie:title", fd.title, uri);
add_tuple (metadata, "nmm:trackNumber", fd.tracknumber);
if (fd.album && album_uri) {
@@ -374,7 +374,7 @@ extract_flac (const gchar *uri,
/* FIXME: Trackgain/Trackpeakgain: commented out in vorbis */
add_tuple (metadata, "nie:comment", fd.comment);
- tracker_guarantee_date_from_filename_mtime (metadata, "nie:contentCreated", fd.date, uri);
+ tracker_guarantee_date_from_file_mtime (metadata, "nie:contentCreated", fd.date, uri);
add_tuple (metadata, "nfo:genre", fd.genre);
add_tuple (metadata, "nie:plainTextContent", fd.lyrics);
add_tuple (metadata, "nie:copyright", fd.copyright);
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c
index 4dfc1c6..61f3b94 100644
--- a/src/tracker-extract/tracker-extract-gif.c
+++ b/src/tracker-extract/tracker-extract-gif.c
@@ -229,10 +229,10 @@ read_metadata (TrackerSparqlBuilder *preupdate,
g_free (uri);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- "nie:contentCreated",
- md.date,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ "nie:contentCreated",
+ md.date,
+ uri);
if (xd->description) {
tracker_sparql_builder_predicate (metadata, "nie:description");
@@ -270,10 +270,10 @@ read_metadata (TrackerSparqlBuilder *preupdate,
g_free (equip_uri);
}
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- md.title,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ md.title,
+ uri);
if (md.artist) {
gchar *uri = tracker_sparql_escape_uri_printf ("urn:contact:%s", md.artist);
diff --git a/src/tracker-extract/tracker-extract-gupnp-dlna.c b/src/tracker-extract/tracker-extract-gupnp-dlna.c
index 07a80ab..94d807b 100644
--- a/src/tracker-extract/tracker-extract-gupnp-dlna.c
+++ b/src/tracker-extract/tracker-extract-gupnp-dlna.c
@@ -294,10 +294,10 @@ add_y_date_gst_tag (TrackerSparqlBuilder *metadata,
g_date_free (date);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- key,
- buf,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ key,
+ buf,
+ uri);
}
static void
@@ -609,10 +609,10 @@ extract_metadata (MetadataExtractor *extractor,
s = NULL;
ret = gst_tag_list_get_string (extractor->tags, GST_TAG_TITLE, &s);
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- s,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ s,
+ uri);
g_free (s);
add_string_gst_tag (metadata, uri, "nie:copyright", extractor->tags, GST_TAG_COPYRIGHT);
diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index 409f25d..71e8007 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -403,10 +403,10 @@ extract_jpeg (const gchar *uri,
g_free (equip_uri);
}
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- md.title,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ md.title,
+ uri);
if (md.orientation) {
tracker_sparql_builder_predicate (metadata, "nfo:orientation");
@@ -476,10 +476,10 @@ extract_jpeg (const gchar *uri,
tracker_sparql_builder_object_double (metadata, value);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- "nie:contentCreated",
- md.date,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ "nie:contentCreated",
+ md.date,
+ uri);
if (md.description) {
tracker_sparql_builder_predicate (metadata, "nie:description");
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index b976495..d7dc2d7 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -2269,10 +2269,10 @@ extract_mp3 (const gchar *uri,
tracker_sparql_builder_object (metadata, "nmm:MusicPiece");
tracker_sparql_builder_object (metadata, "nfo:Audio");
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- md.title,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ md.title,
+ uri);
if (md.lyricist_uri) {
tracker_sparql_builder_predicate (metadata, "nmm:lyricist");
@@ -2297,10 +2297,10 @@ extract_mp3 (const gchar *uri,
tracker_sparql_builder_object_iri (metadata, md.album_uri);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- "nie:contentCreated",
- md.recording_time,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ "nie:contentCreated",
+ md.recording_time,
+ uri);
if (md.genre) {
tracker_sparql_builder_predicate (metadata, "nfo:genre");
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index 8e780d2..24da952 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -241,10 +241,10 @@ read_metadata (TrackerSparqlBuilder *preupdate,
g_free (uri);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- "nie:contentCreated",
- md.date,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ "nie:contentCreated",
+ md.date,
+ uri);
if (md.description) {
tracker_sparql_builder_predicate (metadata, "nie:description");
@@ -256,10 +256,10 @@ read_metadata (TrackerSparqlBuilder *preupdate,
tracker_sparql_builder_object_unvalidated (metadata, md.copyright);
}
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- md.title,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ md.title,
+ uri);
if (md.make || md.model) {
gchar *equip_uri;
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 274a899..a53de38 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -598,10 +598,10 @@ extract_tiff (const gchar *uri,
g_free (equip_uri);
}
- tracker_guarantee_title_from_filename (metadata,
- "nie:title",
- md.title,
- uri);
+ tracker_guarantee_title_from_file (metadata,
+ "nie:title",
+ md.title,
+ uri);
if (md.orientation) {
tracker_sparql_builder_predicate (metadata, "nfo:orientation");
@@ -659,10 +659,10 @@ extract_tiff (const gchar *uri,
tracker_sparql_builder_object_unvalidated (metadata, md.iso_speed_ratings);
}
- tracker_guarantee_date_from_filename_mtime (metadata,
- "nie:contentCreated",
- md.date,
- uri);
+ tracker_guarantee_date_from_file_mtime (metadata,
+ "nie:contentCreated",
+ md.date,
+ uri);
if (md.description) {
tracker_sparql_builder_predicate (metadata, "nie:description");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]