/
/
/
1"""Open Subsonic music provider support for MusicAssistant."""
2
3from __future__ import annotations
4
5from typing import TYPE_CHECKING
6
7from music_assistant_models.enums import ProviderFeature
8
9from .sonic_provider import OpenSonicProvider
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_PLAYLISTS_EDIT,
24 ProviderFeature.BROWSE,
25 ProviderFeature.SEARCH,
26 ProviderFeature.RECOMMENDATIONS,
27 ProviderFeature.ARTIST_ALBUMS,
28 ProviderFeature.ARTIST_TOPTRACKS,
29 ProviderFeature.SIMILAR_TRACKS,
30 ProviderFeature.PLAYLIST_TRACKS_EDIT,
31 ProviderFeature.PLAYLIST_CREATE,
32 ProviderFeature.LIBRARY_RADIOS,
33 ProviderFeature.LIBRARY_PODCASTS,
34 ProviderFeature.LIBRARY_PODCASTS_EDIT,
35 ProviderFeature.FAVORITE_ALBUMS_EDIT,
36 ProviderFeature.FAVORITE_ARTISTS_EDIT,
37 ProviderFeature.FAVORITE_TRACKS_EDIT,
38 ProviderFeature.LYRICS,
39}
40
41
42async def setup(
43 mass: MusicAssistant, manifest: ProviderManifest, config: ProviderConfig
44) -> ProviderInstanceType:
45 """Initialize provider(instance) with given configuration."""
46 return OpenSonicProvider(mass, manifest, config, SUPPORTED_FEATURES)
47