/
/
/
1"""Yandex 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 YandexMusicProvider
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.LIBRARY_PODCASTS,
24 ProviderFeature.LIBRARY_AUDIOBOOKS,
25 ProviderFeature.ARTIST_ALBUMS,
26 ProviderFeature.ARTIST_TOPTRACKS,
27 ProviderFeature.SEARCH,
28 ProviderFeature.LIBRARY_ARTISTS_EDIT,
29 ProviderFeature.LIBRARY_ALBUMS_EDIT,
30 ProviderFeature.LIBRARY_TRACKS_EDIT,
31 ProviderFeature.LIBRARY_PODCASTS_EDIT,
32 ProviderFeature.LIBRARY_AUDIOBOOKS_EDIT,
33 ProviderFeature.BROWSE,
34 ProviderFeature.SIMILAR_TRACKS,
35 ProviderFeature.SIMILAR_ARTISTS,
36 ProviderFeature.RECOMMENDATIONS,
37 ProviderFeature.LYRICS,
38}
39
40
41async def setup(
42 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
43) -> ProviderInstanceType:
44 """Initialize provider(instance) with given configuration."""
45 return YandexMusicProvider(mass, manifest, config, SUPPORTED_FEATURES)
46