diff --git a/src/input/plugins/QobuzLoginRequest.cxx b/src/input/plugins/QobuzLoginRequest.cxx index 38238aaf3..380e6028c 100644 --- a/src/input/plugins/QobuzLoginRequest.cxx +++ b/src/input/plugins/QobuzLoginRequest.cxx @@ -82,7 +82,6 @@ QobuzLoginRequest::QobuzLoginRequest(CurlGlobal &curl, const char *device_manufacturer_id, QobuzLoginHandler &_handler) noexcept :request(curl, *this), - parser(&parse_callbacks, nullptr, this), handler(_handler) { request.SetUrl(MakeLoginUrl(request.Get(), base_url, app_id, @@ -105,6 +104,8 @@ QobuzLoginRequest::OnHeaders(unsigned status, auto i = headers.find("content-type"); if (i == headers.end() || i->second.find("/json") == i->second.npos) throw std::runtime_error("Not a JSON response from Qobuz"); + + parser = {&parse_callbacks, nullptr, this}; } void diff --git a/src/input/plugins/QobuzTrackRequest.cxx b/src/input/plugins/QobuzTrackRequest.cxx index 81d533fe2..1de7e6a8e 100644 --- a/src/input/plugins/QobuzTrackRequest.cxx +++ b/src/input/plugins/QobuzTrackRequest.cxx @@ -55,7 +55,6 @@ QobuzTrackRequest::QobuzTrackRequest(QobuzClient &client, :request(client.GetCurl(), MakeTrackUrl(client, track_id).c_str(), *this), - parser(&parse_callbacks, nullptr, this), handler(_handler) { request_headers.Append(("X-User-Auth-Token:" @@ -78,6 +77,8 @@ QobuzTrackRequest::OnHeaders(unsigned status, auto i = headers.find("content-type"); if (i == headers.end() || i->second.find("/json") == i->second.npos) throw std::runtime_error("Not a JSON response from Qobuz"); + + parser = {&parse_callbacks, nullptr, this}; } void