mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
register import hook only if needed
This commit is contained in:
parent
740b510ed7
commit
4884ae3c46
1 changed files with 7 additions and 4 deletions
|
|
@ -119,7 +119,7 @@ def ft_in_title(item, drop_feat):
|
|||
class FtInTitlePlugin(BeetsPlugin):
|
||||
def __init__(self):
|
||||
super(FtInTitlePlugin, self).__init__()
|
||||
self.import_stages = [self.imported]
|
||||
|
||||
self.config.add({
|
||||
'auto': True,
|
||||
'drop': False
|
||||
|
|
@ -134,6 +134,9 @@ class FtInTitlePlugin(BeetsPlugin):
|
|||
action='store_true', default=False,
|
||||
help='drop featuring from artists and ignore title update')
|
||||
|
||||
if self.config['auto']:
|
||||
self.import_stages = [self.imported]
|
||||
|
||||
def commands(self):
|
||||
|
||||
def func(lib, opts, args):
|
||||
|
|
@ -152,6 +155,6 @@ class FtInTitlePlugin(BeetsPlugin):
|
|||
"""
|
||||
drop_feat = self.config['drop'].get(bool)
|
||||
write = config['import']['write'].get(bool)
|
||||
if self.config['auto'].get(bool):
|
||||
for item in task.imported_items():
|
||||
ft_in_title(item, drop_feat, write)
|
||||
|
||||
for item in task.imported_items():
|
||||
ft_in_title(item, drop_feat, write)
|
||||
|
|
|
|||
Loading…
Reference in a new issue