mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix fallback filename pattern not matching filenames from the calibre library
This commit is contained in:
parent
c0d02ede03
commit
17589abd20
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user