mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Kobo annotations fixes
This commit is contained in:
parent
c691863282
commit
f4ef6bcecd
@ -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'
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user