Kobo driver: Fix bug in managing the Im_Reading category on windows

This commit is contained in:
Kovid Goyal 2010-11-19 22:17:57 -07:00
commit 73cdd7ab4c

View File

@ -354,7 +354,7 @@ class KOBO(USBMS):
ContentID = ContentID.replace(self._main_prefix, '') ContentID = ContentID.replace(self._main_prefix, '')
else: else:
ContentID = path ContentID = path
ContentID = ContentID.replace(self._main_prefix + '.kobo/kepub/', '') ContentID = ContentID.replace(self._main_prefix + self.normalize_path('.kobo/kepub/'), '')
if self._card_a_prefix is not None: if self._card_a_prefix is not None:
ContentID = ContentID.replace(self._card_a_prefix, '') ContentID = ContentID.replace(self._card_a_prefix, '')
@ -507,6 +507,9 @@ class KOBO(USBMS):
t = (ContentID,) t = (ContentID,)
cursor.execute('select DateLastRead from Content where BookID is Null and ContentID = ?', t) cursor.execute('select DateLastRead from Content where BookID is Null and ContentID = ?', t)
result = cursor.fetchone() result = cursor.fetchone()
if result is None:
datelastread = '1970-01-01T00:00:00'
else:
datelastread = result[0] if result[0] is not None else '1970-01-01T00:00:00' datelastread = result[0] if result[0] is not None else '1970-01-01T00:00:00'
t = (datelastread,ContentID,) t = (datelastread,ContentID,)