mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-03 15:20:09 -05:00
[spotify] Set the new protocol as experimental and fallback, old one as default
This commit is contained in:
parent
2547336576
commit
038c741052
@ -217,6 +217,7 @@ static cfg_opt_t sec_spotify[] =
|
||||
CFG_BOOL("base_playlist_disable", cfg_false, CFGF_NONE),
|
||||
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),
|
||||
CFG_END()
|
||||
};
|
||||
|
||||
|
@ -486,6 +486,10 @@ setup(struct input_source *source)
|
||||
return 0;
|
||||
|
||||
error:
|
||||
// This should be removed when we don't default to legacy mode any more
|
||||
DPRINTF(E_INFO, L_SPOTIFY, "Switching off Spotify legacy mode\n");
|
||||
librespotc_legacy_set(ctx->session, false);
|
||||
|
||||
pthread_mutex_unlock(&spotify_ctx_lock);
|
||||
stop(source);
|
||||
|
||||
@ -617,6 +621,13 @@ login(const char *username, const char *token, const char **errmsg)
|
||||
if (!ctx->session)
|
||||
goto error;
|
||||
|
||||
// For now, use old tcp based protocol as default unless configured not to.
|
||||
// Note that setup() will switch the old protocol off on error.
|
||||
if (!cfg_getbool(cfg_getsec(cfg, "spotify"), "disable_legacy_mode"))
|
||||
librespotc_legacy_set(ctx->session, true);
|
||||
else
|
||||
DPRINTF(E_INFO, L_SPOTIFY, "Using experimental http protocol for Spotify\n");
|
||||
|
||||
ret = postlogin(ctx);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user