From 6f3aae2925cba9e220055f999bf3c677f7183fbb Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 28 Aug 2014 23:31:55 +0200
Subject: [PATCH] tracker-extract: Add fallback for creation date in EPubs

If we only have this in the OPF file:
<dc:date>2011-04-13</dc:date>
use this as the date.

https://bugzilla.gnome.org/show_bug.cgi?id=735645
---
 src/tracker-extract/tracker-extract-epub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tracker-extract/tracker-extract-epub.c b/src/tracker-extract/tracker-extract-epub.c
index 55a27d8..4347374 100644
--- a/src/tracker-extract/tracker-extract-epub.c
+++ b/src/tracker-extract/tracker-extract-epub.c
@@ -195,6 +195,8 @@ opf_xml_start_element_handler (GMarkupParseContext  *context,
 					break;
 				}
 			}
+			if (data->element == OPF_TAG_TYPE_UNKNOWN)
+				data->element = OPF_TAG_TYPE_CREATED;
 		} else if (g_strcmp0 (element_name, "dc:publisher") == 0) {
 			data->element = OPF_TAG_TYPE_PUBLISHER;
 		} else if (g_strcmp0 (element_name, "dc:description") == 0) {
-- 
2.1.0