Content server: Fix _ to represent current library in calibre:// URLs not working

This commit is contained in:
Kovid Goyal 2025-01-10 13:24:21 +05:30
parent 52664a357a
commit 4fd6fa2441
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -179,6 +179,8 @@ def replace_calibre_links_to_books(html):
lib = lib[6:] lib = lib[6:]
v'const uint8Array = new Uint8Array(lib.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));' v'const uint8Array = new Uint8Array(lib.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));'
v'lib = new TextDecoder("utf-8").decode(uint8Array);' v'lib = new TextDecoder("utf-8").decode(uint8Array);'
elif lib is '_':
lib = current_library_id()
if url.hostname is 'show-book': if url.hostname is 'show-book':
new_href = query_as_href({'book_id': book_id + '', 'library_id': lib}, 'book_details') new_href = query_as_href({'book_id': book_id + '', 'library_id': lib}, 'book_details')
else: else: