Kobo annotations fixes

This commit is contained in:
Timothy Legge 2011-10-24 22:52:39 -03:00
parent c691863282
commit f4ef6bcecd
2 changed files with 11 additions and 6 deletions

View File

@ -55,6 +55,7 @@ class Bookmark(): # {{{
'bm.volumeid = ? order by bm.volumeid, bm.chapterprogress', t)
previous_chapter = 0
bm_count = 0
for row in cursor:
current_chapter = row[10]
if previous_chapter == current_chapter:
@ -70,7 +71,7 @@ class Bookmark(): # {{{
e_type = 'Bookmark'
text = row[9]
# highlight is text with no annotation
elif text is not None and annotation is None:
elif text is not None and (annotation is None or annotation == ""):
e_type = 'Highlight'
elif text and annotation:
e_type = 'Annotation'

View File

@ -967,10 +967,14 @@ class KOBO(USBMS):
timestamp = bookmark.timestamp
percent_read = bookmark.percent_read
debug_print("Date: ", bookmark.last_read)
if bookmark.last_read is not None:
try:
last_read = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(calendar.timegm(time.strptime(bookmark.last_read, "%Y-%m-%dT%H:%M:%S"))))
except:
last_read = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(calendar.timegm(time.strptime(bookmark.last_read, "%Y-%m-%dT%H:%M:%S.%f"))))
else:
#self.datetime = time.gmtime()
last_read = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
# debug_print("Percent read: ", percent_read)
ka_soup = BeautifulSoup()