[spotify] Make client_id and secret configurable

Closes #1877
This commit is contained in:
ejurgensen 2025-03-20 20:31:57 +01:00
parent 13a8f71c0c
commit d99342e586
2 changed files with 9 additions and 3 deletions

View File

@ -219,6 +219,9 @@ static cfg_opt_t sec_spotify[] =
CFG_BOOL("artist_override", cfg_false, CFGF_NONE),
CFG_BOOL("album_override", cfg_false, CFGF_NONE),
CFG_BOOL("disable_legacy_mode", cfg_false, CFGF_NONE),
// Issued by Spotify on developer.spotify.com for forked-daapd/OwnTone
CFG_STR("webapi_client_id", "0e684a5422384114a8ae7ac020f01789", CFGF_NONE),
CFG_STR("webapi_client_secret", "232af95f39014c9ba218285a5c11a239", CFGF_NONE),
CFG_END()
};

View File

@ -147,10 +147,10 @@ static int spotify_base_plid;
// Flag to avoid triggering playlist change events while the (re)scan is running
static bool scanning;
// Endpoints and credentials for the web api
static const char *spotify_client_id = "0e684a5422384114a8ae7ac020f01789";
static const char *spotify_client_secret = "232af95f39014c9ba218285a5c11a239";
static const char *spotify_client_id;
static const char *spotify_client_secret;
static const char *spotify_scope = "playlist-read-private playlist-read-collaborative user-library-read user-read-private streaming";
static const char *spotify_auth_uri = "https://accounts.spotify.com/authorize";
@ -2067,6 +2067,9 @@ spotifywebapi_library_init()
{
int ret;
spotify_client_id = cfg_getstr(cfg_getsec(cfg, "spotify"), "webapi_client_id");
spotify_client_secret = cfg_getstr(cfg_getsec(cfg, "spotify"), "webapi_client_secret");
ret = spotify_init();
if (ret < 0)
return -1;