From 17589abd201d3a7d4e83742d6b0589997628c791 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 18 Feb 2014 12:54:30 +0530 Subject: [PATCH] Fix fallback filename pattern not matching filenames from the calibre library --- src/calibre/ebooks/metadata/meta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/meta.py b/src/calibre/ebooks/metadata/meta.py index f358394ea6..ecb681056c 100644 --- a/src/calibre/ebooks/metadata/meta.py +++ b/src/calibre/ebooks/metadata/meta.py @@ -110,9 +110,9 @@ def _get_metadata(stream, stream_type, use_libprs_metadata, # 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 - # in: title_-_author_number.extension + # in the library title - author.extension base.smart_update(metadata_from_filename(name, re.compile( - r'^(?P[ \S]+?)[ _]-[ _](?P<author>[ \S]+?)_+\d+'))) + r'^(?P<title>.+)[ _]-[ _](?P<author>[^-]+)$'))) if base.title: base.title = base.title.replace('_', ' ') if base.authors: