/
/
/
1"""KION Music provider support for Music Assistant."""
2
3from __future__ import annotations
4
5from typing import TYPE_CHECKING
6
7from music_assistant_models.enums import ProviderFeature
8
9from .provider import KionMusicProvider
10
11if TYPE_CHECKING:
12 from music_assistant_models.config_entries import ProviderConfig
13 from music_assistant_models.provider import ProviderManifest
14
15 from music_assistant.mass import MusicAssistant
16 from music_assistant.models import ProviderInstanceType
17
18SUPPORTED_FEATURES = {
19 ProviderFeature.LIBRARY_ARTISTS,
20 ProviderFeature.LIBRARY_ALBUMS,
21 ProviderFeature.LIBRARY_TRACKS,
22 ProviderFeature.LIBRARY_PLAYLISTS,
23 ProviderFeature.ARTIST_ALBUMS,
24 ProviderFeature.ARTIST_TOPTRACKS,
25 ProviderFeature.SEARCH,
26 ProviderFeature.LIBRARY_ARTISTS_EDIT,
27 ProviderFeature.LIBRARY_ALBUMS_EDIT,
28 ProviderFeature.LIBRARY_TRACKS_EDIT,
29 ProviderFeature.BROWSE,
30 ProviderFeature.SIMILAR_TRACKS,
31 ProviderFeature.SIMILAR_ARTISTS,
32 ProviderFeature.RECOMMENDATIONS,
33 ProviderFeature.LYRICS,
34}
35
36
37async def setup(
38 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
39) -> ProviderInstanceType:
40 """Initialize provider(instance) with given configuration."""
41 return KionMusicProvider(mass, manifest, config, SUPPORTED_FEATURES)
42