From 6c8746bed93246bdc989c22182c52652af7c1c09 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Oct 2010 13:30:59 -0600 Subject: [PATCH] Fix #7054 (Issue while importing book where isbn is present in file name) --- src/calibre/ebooks/metadata/book/__init__.py | 3 ++- src/calibre/ebooks/metadata/meta.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/book/__init__.py b/src/calibre/ebooks/metadata/book/__init__.py index e6dff9110b..761a573b69 100644 --- a/src/calibre/ebooks/metadata/book/__init__.py +++ b/src/calibre/ebooks/metadata/book/__init__.py @@ -114,7 +114,8 @@ SC_COPYABLE_FIELDS = SOCIAL_METADATA_FIELDS.union( PUBLICATION_METADATA_FIELDS).union( BOOK_STRUCTURE_FIELDS).union( DEVICE_METADATA_FIELDS).union( - CALIBRE_METADATA_FIELDS) - \ + CALIBRE_METADATA_FIELDS).union( + TOP_LEVEL_CLASSIFIERS) - \ SC_FIELDS_NOT_COPIED.union( SC_FIELDS_COPY_NOT_NULL) diff --git a/src/calibre/ebooks/metadata/meta.py b/src/calibre/ebooks/metadata/meta.py index b02ae2dbff..87b8d3b535 100644 --- a/src/calibre/ebooks/metadata/meta.py +++ b/src/calibre/ebooks/metadata/meta.py @@ -108,7 +108,8 @@ def _get_metadata(stream, stream_type, use_libprs_metadata, base = metadata_from_filename(name, pat=pattern) if force_read_metadata or is_recipe(name) or prefs['read_file_metadata']: mi = get_file_type_metadata(stream, stream_type) - if base.title == os.path.splitext(name)[0] and base.authors is None: + if base.title == os.path.splitext(name)[0] and \ + base.is_null('authors') and base.is_null('isbn'): # Assume that there was no metadata in the file and the user set pattern # to match meta info from the file name did not match. # The regex is meant to match the standard format filenames are written