From 0fe81939ea5697b8b66863fb37ca6b5ab33ef5f6 Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Fri, 10 Sep 2010 20:53:26 -0300 Subject: [PATCH] Fix long standing bug in date shown for kobo books --- src/calibre/devices/kobo/books.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/calibre/devices/kobo/books.py b/src/calibre/devices/kobo/books.py index 9da99d75c8..496162d668 100644 --- a/src/calibre/devices/kobo/books.py +++ b/src/calibre/devices/kobo/books.py @@ -44,16 +44,17 @@ class Book(MetaInformation): self.mime = mime self.size = size # will be set later if None - try: - if ContentType == '6': - self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f") - else: - self.datetime = time.gmtime(os.path.getctime(self.path)) - except: - self.datetime = time.gmtime() - if thumbnail_name is not None: - self.thumbnail = ImageWrapper(thumbnail_name) + if ContentType == '6': + self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f") + else: + try: + self.datetime = time.gmtime(os.path.getctime(self.path)) + except: + self.datetime = time.gmtime() + + if thumbnail_name is not None: + self.thumbnail = ImageWrapper(thumbnail_name) self.tags = [] if other: self.smart_update(other)