mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
correctly handle the formatter parameter in the cache and in Metadata
This commit is contained in:
parent
8467baea33
commit
6315a05142
@ -280,8 +280,7 @@ class ProxyMetadata(Metadata):
|
||||
|
||||
def __init__(self, db, book_id, formatter=None):
|
||||
sa(self, 'template_cache', db.formatter_template_cache)
|
||||
if formatter is None:
|
||||
sa(self, 'formatter', SafeFormat())
|
||||
sa(self, 'formatter', SafeFormat() if formatter is None else formatter)
|
||||
sa(self, '_db', weakref.ref(db))
|
||||
sa(self, '_book_id', book_id)
|
||||
sa(self, '_cache', {'user_categories':{}, 'cover_data':(None,None), 'device_collections':[]})
|
||||
|
@ -87,7 +87,7 @@ class Metadata(object):
|
||||
self.authors = list(authors) if authors else []
|
||||
from calibre.ebooks.metadata.book.formatter import SafeFormat
|
||||
if formatter is None:
|
||||
self.formatter = SafeFormat()
|
||||
self.formatter = SafeFormat() if formatter is None else formatter
|
||||
self.template_cache = template_cache
|
||||
|
||||
def is_null(self, field):
|
||||
|
Loading…
x
Reference in New Issue
Block a user