local: Convert local scanning to new commands.

Also moves mopidy.backends.local.scan to .command
This commit is contained in:
Thomas Adamcik 2013-11-14 23:12:42 +01:00
parent da4cfebe05
commit a6c3b78a6f
2 changed files with 11 additions and 6 deletions

View File

@ -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()

View File

@ -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']