From 8b554ee0cda99dd11c50ba6def1634ca2416396b Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 12 Sep 2010 22:04:10 +0100 Subject: [PATCH] Fixes for thumbnails. --- src/calibre/ebooks/metadata/book/__init__.py | 2 +- src/calibre/ebooks/metadata/book/base.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/book/__init__.py b/src/calibre/ebooks/metadata/book/__init__.py index e7f58ce858..84a88606f2 100644 --- a/src/calibre/ebooks/metadata/book/__init__.py +++ b/src/calibre/ebooks/metadata/book/__init__.py @@ -110,7 +110,7 @@ COPYABLE_METADATA_FIELDS = SOCIAL_METADATA_FIELDS.union( frozenset(['title', 'title_sort', 'authors', 'author_sort', 'author_sort_map' 'comments', 'cover_data', 'tags', 'language', 'lpath', - 'size']) + 'size', 'thumbnail']) SERIALIZABLE_FIELDS = SOCIAL_METADATA_FIELDS.union( USER_METADATA_FIELDS).union( diff --git a/src/calibre/ebooks/metadata/book/base.py b/src/calibre/ebooks/metadata/book/base.py index f2031afd0e..7812f81180 100644 --- a/src/calibre/ebooks/metadata/book/base.py +++ b/src/calibre/ebooks/metadata/book/base.py @@ -223,7 +223,7 @@ class Metadata(object): self.author_sort = other.author_sort if replace_metadata: - SPECIAL_FIELDS = frozenset(['lpath', 'size', 'comments']) + SPECIAL_FIELDS = frozenset(['lpath', 'size', 'comments', 'thumbnail']) for attr in COPYABLE_METADATA_FIELDS: setattr(self, attr, getattr(other, attr, 1.0 if \ attr == 'series_index' else None)) @@ -238,6 +238,7 @@ class Metadata(object): for attr in COPYABLE_METADATA_FIELDS: if hasattr(other, attr): copy_not_none(self, other, attr) + copy_not_none(self, other, 'thumbnail') if other.tags: # Case-insensitive but case preserving merging lotags = [t.lower() for t in other.tags]