2018-10-03 18:34:45 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""Top-level package for mopidy-funkwhale."""
|
2018-10-03 18:58:50 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import logging
|
|
|
|
import mopidy.config
|
|
|
|
import mopidy.ext
|
|
|
|
import os
|
|
|
|
|
2018-10-03 18:34:45 +02:00
|
|
|
|
2022-02-04 17:51:08 +01:00
|
|
|
__author__ = """Funkwhale collective"""
|
|
|
|
__email__ = "maintainers@funkwhale.audio"
|
2022-02-06 11:35:51 +01:00
|
|
|
__version__ = "1.0.0"
|
2018-10-03 18:58:50 +02:00
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class Extension(mopidy.ext.Extension):
|
|
|
|
|
2018-10-04 20:57:27 +02:00
|
|
|
dist_name = "Mopidy-Funkwhale"
|
|
|
|
ext_name = "funkwhale"
|
2018-10-03 18:58:50 +02:00
|
|
|
version = __version__
|
|
|
|
|
|
|
|
def get_default_config(self):
|
2018-10-04 20:57:27 +02:00
|
|
|
conf_file = os.path.join(os.path.dirname(__file__), "ext.conf")
|
2018-10-03 18:58:50 +02:00
|
|
|
return mopidy.config.read(conf_file)
|
|
|
|
|
|
|
|
def get_config_schema(self):
|
|
|
|
schema = super(Extension, self).get_config_schema()
|
2018-10-04 20:57:27 +02:00
|
|
|
schema["url"] = mopidy.config.String()
|
2019-05-03 12:22:45 +02:00
|
|
|
schema["authorization_endpoint"] = mopidy.config.String(optional=True)
|
|
|
|
schema["token_endpoint"] = mopidy.config.String(optional=True)
|
|
|
|
schema["client_secret"] = mopidy.config.String(optional=True)
|
|
|
|
schema["client_id"] = mopidy.config.String(optional=True)
|
|
|
|
|
2018-10-05 00:06:09 +02:00
|
|
|
schema["cache_duration"] = mopidy.config.Integer(optional=True)
|
2019-05-03 12:22:45 +02:00
|
|
|
schema["verify_cert"] = mopidy.config.Boolean(optional=True)
|
2021-08-17 04:15:24 +02:00
|
|
|
|
2021-08-17 04:58:21 +02:00
|
|
|
schema["exclude_compilation_artists"] = mopidy.config.Boolean(optional=True)
|
2021-08-17 04:15:24 +02:00
|
|
|
|
2018-10-03 18:58:50 +02:00
|
|
|
return schema
|
|
|
|
|
|
|
|
def setup(self, registry):
|
2018-10-03 21:51:48 +02:00
|
|
|
from . import actor
|
2018-10-04 20:57:27 +02:00
|
|
|
|
|
|
|
registry.add("backend", actor.FunkwhaleBackend)
|
2019-05-03 12:22:45 +02:00
|
|
|
|
|
|
|
def get_command(self):
|
|
|
|
from . import commands
|
|
|
|
|
|
|
|
return commands.FunkwhaleCommand()
|