Fixes #2049428 [Lookup name #readstatus doesn't have a link map](https://bugs.launchpad.net/calibre/+bug/2049428)
This commit is contained in:
Kovid Goyal 2024-01-16 07:08:49 +05:30
commit d4d45eb5b9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -242,7 +242,8 @@ class TagTreeItem: # {{{
tt.append(_('Number of books: %s') % self.item_count)
from calibre.gui2.ui import get_gui
db = get_gui().current_db.new_api
link = db.get_link_map(tag.category).get(tag.original_name)
link = (None if not db.has_link_map(tag.category)
else db.get_link_map(tag.category).get(tag.original_name))
if link:
tt.append(_('Link: %s') % link)
return '\n'.join(tt)