Fix fallback filename pattern not matching filenames from the calibre library

This commit is contained in:
Kovid Goyal 2014-02-18 12:54:30 +05:30
parent c0d02ede03
commit 17589abd20

View File

@ -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<title>[ \S]+?)[ _]-[ _](?P<author>[ \S]+?)_+\d+')))
r'^(?P<title>.+)[ _]-[ _](?P<author>[^-]+)$')))
if base.title:
base.title = base.title.replace('_', ' ')
if base.authors: