mirror of
https://github.com/beetbox/beets.git
synced 2026-01-02 22:12:53 +01:00
fix plugin errors with missing sections
This commit is contained in:
parent
cd63be80ba
commit
74f14a7aeb
3 changed files with 10 additions and 5 deletions
|
|
@ -59,8 +59,9 @@ class InlinePlugin(BeetsPlugin):
|
|||
cls = type(self)
|
||||
|
||||
# Add field expressions.
|
||||
for key, value in config.items('pathfields', True):
|
||||
log.debug(u'adding template field %s' % key)
|
||||
func = compile_expr(value)
|
||||
if func is not None:
|
||||
cls.template_fields[key] = func
|
||||
if config.has_section('pathfields'):
|
||||
for key, value in config.items('pathfields', True):
|
||||
log.debug(u'adding template field %s' % key)
|
||||
func = compile_expr(value)
|
||||
if func is not None:
|
||||
cls.template_fields[key] = func
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ class RewritePlugin(BeetsPlugin):
|
|||
|
||||
# Gather all the rewrite rules for each field.
|
||||
rules = defaultdict(list)
|
||||
if not config.has_section('rewrite'):
|
||||
return
|
||||
for key, value in config.items('rewrite', True):
|
||||
try:
|
||||
fieldname, pattern = key.split(None, 1)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ Changelog
|
|||
recording associated with a fingerprint.
|
||||
* Fix a crash when an autotagging with an artist or album containing "AND" or
|
||||
"OR" (upper case).
|
||||
* Fix an error in the ``rewrite`` and ``inline`` plugins when the corresponding
|
||||
config sections did not exist.
|
||||
|
||||
1.0b12 (January 16, 2012)
|
||||
-------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue