mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
fromfilename: fix #460: crash w/ no capture groups
This commit is contained in:
parent
a3c1b15198
commit
456c8a7f01
2 changed files with 6 additions and 1 deletions
|
|
@ -73,7 +73,10 @@ def all_matches(names, pattern):
|
|||
matches = {}
|
||||
for item, name in names.items():
|
||||
m = re.match(pattern, name, re.IGNORECASE)
|
||||
if m:
|
||||
if m and m.groupdict():
|
||||
# Only yield a match when the regex applies *and* has
|
||||
# capture groups. Otherwise, no information can be extracted
|
||||
# from the filename.
|
||||
matches[item] = m.groupdict()
|
||||
else:
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ Other little fixes:
|
|||
* The importer now uses the album artist field when guessing existing
|
||||
metadata for albums (rather than just the track artist field). Thanks to
|
||||
geigerzaehler.
|
||||
* :doc:`/plugins/fromfilename`: Fix a crash when a filename contained only a
|
||||
track number (e.g., ``02.mp3``).
|
||||
|
||||
|
||||
1.3.2 (December 22, 2013)
|
||||
|
|
|
|||
Loading…
Reference in a new issue