mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix regression that broke deepcopying of Metadata() objects
This commit is contained in:
parent
654ce41161
commit
7af7030d98
@ -14,16 +14,15 @@ class SafeFormat(TemplateFormatter):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
TemplateFormatter.__init__(self)
|
TemplateFormatter.__init__(self)
|
||||||
from calibre.ebooks.metadata.book.base import field_metadata
|
|
||||||
self.field_metadata = field_metadata
|
|
||||||
|
|
||||||
def get_value(self, orig_key, args, kwargs):
|
def get_value(self, orig_key, args, kwargs):
|
||||||
if not orig_key:
|
if not orig_key:
|
||||||
return ''
|
return ''
|
||||||
key = orig_key = orig_key.lower()
|
key = orig_key = orig_key.lower()
|
||||||
if key != 'title_sort' and key not in TOP_LEVEL_IDENTIFIERS and \
|
if (key != 'title_sort' and key not in TOP_LEVEL_IDENTIFIERS and
|
||||||
key not in ALL_METADATA_FIELDS:
|
key not in ALL_METADATA_FIELDS):
|
||||||
key = self.field_metadata.search_term_to_field_key(key)
|
from calibre.ebooks.metadata.book.base import field_metadata
|
||||||
|
key = field_metadata.search_term_to_field_key(key)
|
||||||
if key is None or (self.book and
|
if key is None or (self.book and
|
||||||
key not in self.book.all_field_keys()):
|
key not in self.book.all_field_keys()):
|
||||||
if hasattr(self.book, orig_key):
|
if hasattr(self.book, orig_key):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user