mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
move _command into command
This commit is contained in:
parent
acf447b4b0
commit
e6da3e1498
1 changed files with 10 additions and 11 deletions
|
|
@ -75,15 +75,6 @@ class ParentWorkPlugin(BeetsPlugin):
|
|||
'force': False,
|
||||
})
|
||||
|
||||
self._command = ui.Subcommand(
|
||||
'parentwork',
|
||||
help=u'Fetches parent works, composers and dates')
|
||||
|
||||
self._command.parser.add_option(
|
||||
u'-f', u'--force', dest='force',
|
||||
action='store_true', default=None,
|
||||
help=u'Re-fetches all parent works')
|
||||
|
||||
if self.config['auto']:
|
||||
self.import_stages = [self.imported]
|
||||
|
||||
|
|
@ -99,9 +90,17 @@ class ParentWorkPlugin(BeetsPlugin):
|
|||
item.store()
|
||||
if write:
|
||||
item.try_write()
|
||||
command = ui.Subcommand(
|
||||
'parentwork',
|
||||
help=u'Fetches parent works, composers and dates')
|
||||
|
||||
self._command.func = func
|
||||
return [self._command]
|
||||
command.parser.add_option(
|
||||
u'-f', u'--force', dest='force',
|
||||
action='store_true', default=None,
|
||||
help=u'Re-fetches all parent works')
|
||||
|
||||
command.func = func
|
||||
return [command]
|
||||
|
||||
def imported(self, session, task):
|
||||
"""Import hook for fetching parent works automatically.
|
||||
|
|
|
|||
Loading…
Reference in a new issue