[discident-glib] Print the title when printing the GTIN



commit 79554a70ffe4a8a185f2e4dfa2f45d47fd8b0101
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 18 00:34:00 2010 +0000

    Print the title when printing the GTIN

 discident-glib/test-diglib.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/discident-glib/test-diglib.c b/discident-glib/test-diglib.c
index 66fadac..5037755 100644
--- a/discident-glib/test-diglib.c
+++ b/discident-glib/test-diglib.c
@@ -135,7 +135,7 @@ int main (int argc, char **argv)
 
 	for (i = 0; uris[i] != NULL; i++) {
 		GFile *file;
-		char *id;
+		char *gtin;
 		GError *error = NULL;
 
 		file= g_file_new_for_path (uris[i]);
@@ -145,15 +145,25 @@ int main (int argc, char **argv)
 		}
 		g_object_set_data (G_OBJECT (file), "wants-file-list", GINT_TO_POINTER (option_file_list));
 		if (!option_async) {
-			id = discident_get_gtin_file (file, &error);
-			g_object_unref (file);
-			if (id == NULL) {
+			char *uri, *title;
+			gtin = discident_get_gtin_file (file, &error);
+			if (gtin == NULL) {
+				g_object_unref (file);
 				g_message ("Could not get disc ID: %s", error->message);
 				g_error_free (error);
 				continue;
 			}
-			g_print ("%s\n", id);
-			g_free (id);
+			uri = g_file_get_uri (file);
+			g_object_unref (file);
+			g_print ("URI: %s\n", uri);
+			g_free (uri);
+
+			g_print ("Disc GTIN: %s\n", gtin);
+
+			title = discident_get_title_for_gtin (gtin, NULL);
+			g_free (gtin);
+			g_print ("Title: %s\n", title);
+			g_free (title);
 		} else {
 			num_queries++;
 			discident_get_gtin_file_async (file, NULL, discident_print, NULL);



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