From a5b4012059df8edf5d1b3289f31027b82e6c7c11 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 17 May 2010 13:06:39 -0600 Subject: [PATCH] Fix regression taht caused usbms based drivers to not get correct timestamp for files on device --- src/calibre/devices/usbms/books.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index 59f098d421..879b377b1b 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -38,8 +38,10 @@ class Book(MetaInformation): self.lpath = lpath self.mime = mime_type_ext(path_to_ext(lpath)) self.size = size # will be set later if None - self.datetime = time.gmtime() - + try: + self.datetime = time.gmtime(os.path.getctime(self.path)) + except: + self.datetime = time.gmtime() if other: self.smart_update(other)