mopidy/mopidy/backends/local/__init__.py
Thomas Adamcik 36266064d3 config: Switch all paths and files to use the Path in schemas.
Also renames static_dir to static_path for better consistency.
2013-04-05 22:50:31 +02:00

69 lines
1.4 KiB
Python

from __future__ import unicode_literals
import mopidy
from mopidy import ext
from mopidy.utils import config, formatting
default_config = """
[local]
# If the local extension should be enabled or not
enabled = true
# Path to folder with local music
music_path = $XDG_MUSIC_DIR
# Path to playlist folder with m3u files for local music
playlist_path = $XDG_DATA_DIR/mopidy/playlists
# Path to tag cache for local music
tag_cache_file = $XDG_DATA_DIR/mopidy/tag_cache
"""
__doc__ = """A backend for playing music from a local music archive.
This backend handles URIs starting with ``file:``.
See :ref:`music-from-local-storage` for further instructions on using this
backend.
**Issues**
https://github.com/mopidy/mopidy/issues?labels=Local+backend
**Dependencies**
None
**Default config**
.. code-block:: ini
%(config)s
""" % {'config': formatting.indent(default_config)}
class Extension(ext.Extension):
dist_name = 'Mopidy-Local'
ext_name = 'local'
version = mopidy.__version__
def get_default_config(self):
return default_config
def get_config_schema(self):
schema = config.ExtensionConfigSchema()
schema['music_path'] = config.Path()
schema['playlist_path'] = config.Path()
schema['tag_cache_file'] = config.Path()
return schema
def validate_environment(self):
pass
def get_backend_classes(self):
from .actor import LocalBackend
return [LocalBackend]