Content server: Get custom column web search templates as well

This commit is contained in:
Kovid Goyal 2025-02-08 12:52:23 +05:30
parent 0efd8c7b6d
commit 65f89bda7a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -289,6 +289,10 @@ def render_metadata(mi, table, book_id, iframe_css): # {{{
websearch_link = False websearch_link = False
if field is 'authors': if field is 'authors':
websearch_link = bool(interface_data.default_author_link) and interface_data.default_author_link is not 'search-calibre' websearch_link = bool(interface_data.default_author_link) and interface_data.default_author_link is not 'search-calibre'
else:
fm = field_metadata[field]
if fm?.display and fm.display.web_search_template and fm.display.web_search_template.partition(':')[0] in ('http', 'https'):
websearch_link = True
text_rep = search_text or v text_rep = search_text or v
target = '_self' target = '_self'
if websearch_link and jstype(v) is not 'string': if websearch_link and jstype(v) is not 'string':