mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure that mi.deepcopy_metadata() keeps the top-level attributes 'id' and 'has_cover'
This commit is contained in:
parent
42502beefd
commit
58b2b5634b
@ -231,6 +231,9 @@ class Metadata:
|
|||||||
# are returning a "real" Metadata instance that has __get_attribute__.
|
# are returning a "real" Metadata instance that has __get_attribute__.
|
||||||
m = Metadata(None)
|
m = Metadata(None)
|
||||||
object.__setattr__(m, '_data', copy.deepcopy(object.__getattribute__(self, '_data')))
|
object.__setattr__(m, '_data', copy.deepcopy(object.__getattribute__(self, '_data')))
|
||||||
|
# Also copy these two top-level attributes as they can appear in templates.
|
||||||
|
object.__setattr__(m, 'id', copy.copy(self.get('id')))
|
||||||
|
object.__setattr__(m, 'has_cover', copy.copy(self.get('has_cover')))
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def get(self, field, default=None):
|
def get(self, field, default=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user