/
/
/
1"""Constants for Apple Music provider."""
2
3from music_assistant_models.enums import ProviderFeature
4
5from music_assistant.helpers.app_vars import app_var
6
7SUPPORTED_FEATURES = {
8 ProviderFeature.LIBRARY_ARTISTS,
9 ProviderFeature.LIBRARY_ALBUMS,
10 ProviderFeature.LIBRARY_TRACKS,
11 ProviderFeature.LIBRARY_PLAYLISTS,
12 ProviderFeature.BROWSE,
13 ProviderFeature.SEARCH,
14 ProviderFeature.RECOMMENDATIONS,
15 ProviderFeature.ARTIST_ALBUMS,
16 ProviderFeature.ARTIST_TOPTRACKS,
17 ProviderFeature.SIMILAR_TRACKS,
18 ProviderFeature.SIMILAR_ARTISTS,
19 ProviderFeature.LIBRARY_ALBUMS_EDIT,
20 ProviderFeature.LIBRARY_ARTISTS_EDIT,
21 ProviderFeature.LIBRARY_PLAYLISTS_EDIT,
22 ProviderFeature.LIBRARY_TRACKS_EDIT,
23 ProviderFeature.PLAYLIST_TRACKS_EDIT,
24 ProviderFeature.FAVORITE_ALBUMS_EDIT,
25 ProviderFeature.FAVORITE_TRACKS_EDIT,
26 ProviderFeature.FAVORITE_PLAYLISTS_EDIT,
27}
28
29MUSIC_APP_TOKEN = app_var("apple_music_token")
30WIDEVINE_BASE_PATH = "/usr/local/bin/widevine_cdm"
31DECRYPT_CLIENT_ID_FILENAME = "client_id.bin"
32DECRYPT_PRIVATE_KEY_FILENAME = "private_key.pem"
33UNKNOWN_PLAYLIST_NAME = "Unknown Apple Music Playlist"
34CONF_MUSIC_APP_TOKEN = "music_app_token"
35CONF_MUSIC_USER_TOKEN = "music_user_token"
36CONF_MUSIC_USER_MANUAL_TOKEN = "music_user_manual_token"
37CONF_MUSIC_USER_TOKEN_TIMESTAMP = "music_user_token_timestamp"
38CACHE_CATEGORY_DECRYPT_KEY = 1
39MAX_ARTWORK_DIMENSION = 1000
40BLOBSTORE_DOMAIN = "blobstore.apple.com"
41# blobstore artwork URLs are presigned with a ~24h expiry, so resolved artwork
42# URLs may only be cached well below that lifetime
43ARTWORK_CACHE_EXPIRATION = 12 * 60 * 60
44# Bump to re-parse cached api responses whenever the parsed representation changes
45PARSED_ITEM_CACHE_CHECKSUM = "artist_fallback_v1"
46