mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Fix re-opening book from home page after making progress not opening to correct last read position when a user is logged in. Fixes 2011755
This commit is contained in:
parent
8e18a509cb
commit
8e1982c700
@ -42,6 +42,12 @@ def update_recently_read_by_user(items):
|
|||||||
recently_read_by_user.updated = True
|
recently_read_by_user.updated = True
|
||||||
|
|
||||||
|
|
||||||
|
def update_book_in_recently_read_by_user_on_home_page(library_id, book_id, book_format, cfi):
|
||||||
|
for item in recently_read_by_user.items:
|
||||||
|
if item.library_id is library_id and item.book_id is book_id and item.format is book_format:
|
||||||
|
item.cfi = cfi
|
||||||
|
|
||||||
|
|
||||||
def show_cover(blob, name, mt, book):
|
def show_cover(blob, name, mt, book):
|
||||||
img = document.getElementById(this)
|
img = document.getElementById(this)
|
||||||
if not img:
|
if not img:
|
||||||
|
@ -7,6 +7,7 @@ from elementmaker import E
|
|||||||
import read_book.iframe # noqa
|
import read_book.iframe # noqa
|
||||||
from ajax import ajax_send
|
from ajax import ajax_send
|
||||||
from book_list.globals import get_session_data
|
from book_list.globals import get_session_data
|
||||||
|
from book_list.home import update_book_in_recently_read_by_user_on_home_page
|
||||||
from book_list.theme import cached_color_to_rgba, get_color, set_ui_colors
|
from book_list.theme import cached_color_to_rgba, get_color, set_ui_colors
|
||||||
from book_list.ui import query_as_href
|
from book_list.ui import query_as_href
|
||||||
from dom import add_extra_css, build_rule, clear, set_css, svgicon, unique_id
|
from dom import add_extra_css, build_rule, clear, set_css, svgicon, unique_id
|
||||||
@ -1245,6 +1246,7 @@ class View:
|
|||||||
if end_type is not 'load':
|
if end_type is not 'load':
|
||||||
print('Failed to update last read position, AJAX call did not succeed')
|
print('Failed to update last read position, AJAX call did not succeed')
|
||||||
)
|
)
|
||||||
|
update_book_in_recently_read_by_user_on_home_page(key[0], key[1], key[2], data.cfi)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_position_data(self):
|
def current_position_data(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user