/
/
/
1"""YouSee Musik musicprovider support for MusicAssistant."""
2
3from __future__ import annotations
4
5from typing import TYPE_CHECKING
6
7from music_assistant_models.enums import ProviderFeature
8
9from music_assistant.providers.yousee.provider import YouSeeMusikProvider
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
18
19SUPPORTED_FEATURES = {
20 ProviderFeature.BROWSE,
21 ProviderFeature.SEARCH,
22 ProviderFeature.RECOMMENDATIONS,
23 ProviderFeature.LIBRARY_ARTISTS,
24 ProviderFeature.LIBRARY_ALBUMS,
25 ProviderFeature.LIBRARY_TRACKS,
26 ProviderFeature.LIBRARY_PLAYLISTS,
27 ProviderFeature.ARTIST_ALBUMS,
28 ProviderFeature.ARTIST_TOPTRACKS,
29 ProviderFeature.LIBRARY_ARTISTS_EDIT,
30 ProviderFeature.LIBRARY_ALBUMS_EDIT,
31 ProviderFeature.LIBRARY_TRACKS_EDIT,
32 ProviderFeature.LIBRARY_PLAYLISTS_EDIT,
33 ProviderFeature.PLAYLIST_TRACKS_EDIT,
34 ProviderFeature.PLAYLIST_CREATE,
35 ProviderFeature.SIMILAR_TRACKS,
36 ProviderFeature.LYRICS,
37}
38
39
40async def setup(
41 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
42) -> ProviderInstanceType:
43 """Initialize provider(instance) with given configuration."""
44 # setup is called when the user wants to setup a new provider instance.
45 # you are free to do any preflight checks here and but you must return
46 # an instance of the provider.
47 return YouSeeMusikProvider(mass, manifest, config, SUPPORTED_FEATURES)
48