Fix missing replace_metadata parameter

This commit is contained in:
Charles Haley 2010-07-15 23:19:09 +01:00
parent 43573dca1d
commit 17c9b2f206

View File

@ -72,13 +72,13 @@ class Book(MetaInformation):
def thumbnail(self): def thumbnail(self):
return None return None
def smart_update(self, other): def smart_update(self, other, replace_metadata=False):
''' '''
Merge the information in C{other} into self. In case of conflicts, the information Merge the information in C{other} into self. In case of conflicts, the information
in C{other} takes precedence, unless the information in C{other} is NULL. in C{other} takes precedence, unless the information in C{other} is NULL.
''' '''
MetaInformation.smart_update(self, other, replace_metadata=True) MetaInformation.smart_update(self, other, replace_metadata)
for attr in self.BOOK_ATTRS: for attr in self.BOOK_ATTRS:
if hasattr(other, attr): if hasattr(other, attr):
@ -116,7 +116,7 @@ class BookList(_BookList):
self.append(book) self.append(book)
return True return True
if replace_metadata: if replace_metadata:
self[b].smart_update(book) self[b].smart_update(book, replace_metadata=True)
return True return True
return False return False