diff --git a/src/input/plugins/TidalInputPlugin.cxx b/src/input/plugins/TidalInputPlugin.cxx index 07dc84b36..307f6214d 100644 --- a/src/input/plugins/TidalInputPlugin.cxx +++ b/src/input/plugins/TidalInputPlugin.cxx @@ -91,6 +91,7 @@ TidalInputStream::OnTidalSession() noexcept tidal_session->GetSession().c_str(), track_id.c_str(), handler); + track_request->Start(); } catch (...) { Failed(std::current_exception()); } diff --git a/src/input/plugins/TidalLoginRequest.cxx b/src/input/plugins/TidalLoginRequest.cxx index 419143325..4b1671298 100644 --- a/src/input/plugins/TidalLoginRequest.cxx +++ b/src/input/plugins/TidalLoginRequest.cxx @@ -59,8 +59,6 @@ TidalLoginRequest::TidalLoginRequest(CurlGlobal &curl, request.SetOption(CURLOPT_COPYPOSTFIELDS, EncodeForm(request.Get(), {{"username", username}, {"password", password}}).c_str()); - - request.StartIndirect(); } TidalLoginRequest::~TidalLoginRequest() noexcept diff --git a/src/input/plugins/TidalLoginRequest.hxx b/src/input/plugins/TidalLoginRequest.hxx index 47fcffe4b..7f6c27375 100644 --- a/src/input/plugins/TidalLoginRequest.hxx +++ b/src/input/plugins/TidalLoginRequest.hxx @@ -44,6 +44,8 @@ public: /** * An asynchronous Tidal "login/username" request. + * + * After construction, call Start() to initiate the request. */ class TidalLoginRequest final : CurlResponseHandler { CurlSlist request_headers; @@ -71,6 +73,10 @@ public: ~TidalLoginRequest() noexcept; + void Start() { + request.StartIndirect(); + } + private: /* virtual methods from CurlResponseHandler */ void OnHeaders(unsigned status, diff --git a/src/input/plugins/TidalSessionManager.cxx b/src/input/plugins/TidalSessionManager.cxx index 48c00ed4c..289d24e97 100644 --- a/src/input/plugins/TidalSessionManager.cxx +++ b/src/input/plugins/TidalSessionManager.cxx @@ -60,6 +60,7 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept token, username, password, handler); + login_request->Start(); } catch (...) { error = std::current_exception(); ScheduleInvokeHandlers(); diff --git a/src/input/plugins/TidalTrackRequest.cxx b/src/input/plugins/TidalTrackRequest.cxx index b5f25a44f..d009a61a1 100644 --- a/src/input/plugins/TidalTrackRequest.cxx +++ b/src/input/plugins/TidalTrackRequest.cxx @@ -61,8 +61,6 @@ TidalTrackRequest::TidalTrackRequest(CurlGlobal &curl, request_headers.Append((std::string("X-Tidal-SessionId:") + session).c_str()); request.SetOption(CURLOPT_HTTPHEADER, request_headers.Get()); - - request.StartIndirect(); } TidalTrackRequest::~TidalTrackRequest() noexcept diff --git a/src/input/plugins/TidalTrackRequest.hxx b/src/input/plugins/TidalTrackRequest.hxx index 12684b65e..33efee5b4 100644 --- a/src/input/plugins/TidalTrackRequest.hxx +++ b/src/input/plugins/TidalTrackRequest.hxx @@ -46,6 +46,8 @@ public: /** * An asynchronous request for the streaming URL of a Tidal track. + * + * After construction, call Start() to initiate the request. */ class TidalTrackRequest final : CurlResponseHandler { CurlSlist request_headers; @@ -74,6 +76,10 @@ public: ~TidalTrackRequest() noexcept; + void Start() { + request.StartIndirect(); + } + private: /* virtual methods from CurlResponseHandler */ void OnHeaders(unsigned status,