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)
|
'bm.volumeid = ? order by bm.volumeid, bm.chapterprogress', t)
|
||||||
|
|
||||||
previous_chapter = 0
|
previous_chapter = 0
|
||||||
|
bm_count = 0
|
||||||
for row in cursor:
|
for row in cursor:
|
||||||
current_chapter = row[10]
|
current_chapter = row[10]
|
||||||
if previous_chapter == current_chapter:
|
if previous_chapter == current_chapter:
|
||||||
@ -70,7 +71,7 @@ class Bookmark(): # {{{
|
|||||||
e_type = 'Bookmark'
|
e_type = 'Bookmark'
|
||||||
text = row[9]
|
text = row[9]
|
||||||
# highlight is text with no annotation
|
# 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'
|
e_type = 'Highlight'
|
||||||
elif text and annotation:
|
elif text and annotation:
|
||||||
e_type = 'Annotation'
|
e_type = 'Annotation'
|
||||||
|
@ -967,11 +967,15 @@ class KOBO(USBMS):
|
|||||||
timestamp = bookmark.timestamp
|
timestamp = bookmark.timestamp
|
||||||
percent_read = bookmark.percent_read
|
percent_read = bookmark.percent_read
|
||||||
debug_print("Date: ", bookmark.last_read)
|
debug_print("Date: ", bookmark.last_read)
|
||||||
try:
|
if bookmark.last_read is not None:
|
||||||
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"))))
|
try:
|
||||||
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"))))
|
||||||
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"))))
|
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)
|
# debug_print("Percent read: ", percent_read)
|
||||||
ka_soup = BeautifulSoup()
|
ka_soup = BeautifulSoup()
|
||||||
dtc = 0
|
dtc = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user