local: Convert local scanning to new commands.
Also moves mopidy.backends.local.scan to .command
This commit is contained in:
parent
da4cfebe05
commit
a6c3b78a6f
@ -37,6 +37,6 @@ class Extension(ext.Extension):
|
||||
from .library import LocalLibraryUpdateProvider
|
||||
return [LocalLibraryUpdateProvider]
|
||||
|
||||
def get_sub_commands(self):
|
||||
from .scan import ScanSubCommand
|
||||
return [ScanSubCommand]
|
||||
def get_command(self):
|
||||
from .command import LocalCommand
|
||||
return LocalCommand()
|
||||
|
||||
@ -14,9 +14,14 @@ from . import translator
|
||||
logger = logging.getLogger('mopidy.backends.local.scan')
|
||||
|
||||
|
||||
class ScanSubCommand(base.BaseSubCommandProvider):
|
||||
name = 'scan'
|
||||
help = 'scan local media files'
|
||||
class LocalCommand(base.Command):
|
||||
def __init__(self):
|
||||
super(LocalCommand, self).__init__()
|
||||
self.add_child('scan', ScanCommand())
|
||||
|
||||
|
||||
class ScanCommand(base.Command):
|
||||
"""Scan local media files"""
|
||||
|
||||
def run(self, args, config, extensions):
|
||||
media_dir = config['local']['media_dir']
|
||||
Loading…
Reference in New Issue
Block a user