mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix display of basic metadata in standalone viewer
This commit is contained in:
parent
95aa3a50c2
commit
5ba3eb19db
@ -21,6 +21,7 @@ from calibre import as_unicode, prints
|
||||
from calibre.constants import (
|
||||
FAKE_HOST, FAKE_PROTOCOL, __version__, is_running_from_develop
|
||||
)
|
||||
from calibre.ebooks.metadata.book.base import field_metadata
|
||||
from calibre.ebooks.oeb.polish.utils import guess_type
|
||||
from calibre.gui2 import error_dialog, open_url
|
||||
from calibre.gui2.webengine import (
|
||||
@ -389,7 +390,7 @@ class WebView(RestartingWebEngineView):
|
||||
return self._page.bridge
|
||||
|
||||
def on_bridge_ready(self):
|
||||
self.bridge.create_view(vprefs['session_data'], QFontDatabase().families())
|
||||
self.bridge.create_view(vprefs['session_data'], QFontDatabase().families(), field_metadata.all_metadata())
|
||||
for func, args in iteritems(self.pending_bridge_ready_actions):
|
||||
getattr(self.bridge, func)(*args)
|
||||
|
||||
|
@ -248,7 +248,10 @@ def render_metadata(mi, table, book_id): # {{{
|
||||
table.appendChild(E.tr(E.td(name + ':'), E.td()))
|
||||
td = table.lastChild.lastChild
|
||||
for k in val:
|
||||
if mi.lang_names:
|
||||
lang = mi.lang_names[k] or k
|
||||
else:
|
||||
lang = k
|
||||
td.appendChild(E.a(lang,
|
||||
title=_('Click to see books with language: {}').format(lang),
|
||||
href=href_for_search(field, k)
|
||||
|
@ -10,6 +10,7 @@ import initialize # noqa: unused-import
|
||||
from ajax import ajax
|
||||
from book_list.globals import set_session_data
|
||||
from book_list.theme import get_color, get_font_family
|
||||
from book_list.library_data import library_data
|
||||
from dom import get_widget_css, set_css
|
||||
from modals import create_modal_container, error_dialog
|
||||
from qt import from_python, to_python
|
||||
@ -176,9 +177,10 @@ def create_session_data(prefs):
|
||||
|
||||
|
||||
@from_python
|
||||
def create_view(prefs, all_font_families):
|
||||
def create_view(prefs, all_font_families, field_metadata):
|
||||
nonlocal view
|
||||
runtime.all_font_families = all_font_families
|
||||
library_data.field_metadata = field_metadata
|
||||
if view is None:
|
||||
create_session_data(prefs)
|
||||
view = View(document.getElementById('view'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user