Distinguish between win32 and win64 in HttpClient's user agent.

This commit is contained in:
casey langen 2020-12-23 10:39:59 -08:00
parent fbbaea0beb
commit b445db5752
4 changed files with 16 additions and 8 deletions

View File

@ -5,9 +5,11 @@
* fixed a bug that was preventing the update check from displaying a dialog on
completion.
* fixed now playing readout ellipsizing.
* fixed a bug where last.fm scrobbles may get posted twice per track.
* added a hotkey to clear the play queue; press 'shift+x' in the play queue
* fixed a bug where `last.fm` scrobbles may get posted twice per track.
* added a hotkey to clear the play queue; press `shift+x` in the play queue
window.
* fixed `HttpClient` user agent to distinguish between `win32` and `win64`
--------------------------------------------------------------------------------
0.96.2

View File

@ -106,7 +106,7 @@ namespace musik { namespace core { namespace sdk {
HttpHeaders requestHeaders, responseHeaders;
HeaderCallback headersCb;
DecoratorCallback decoratorCb;
CanceledCallback canceledCallback;
CanceledCallback canceledCb;
bool cancel;
Thread mode{ Thread::Background };
HttpMethod method{ HttpMethod::Get };
@ -115,7 +115,9 @@ namespace musik { namespace core { namespace sdk {
template <typename T>
std::string HttpClient<T>::DefaultUserAgent() {
#ifdef WIN32
#ifdef _WIN64
static const std::string PLATFORM = "win64";
#elif WIN32
static const std::string PLATFORM = "win32";
#elif defined __APPLE__
static const std::string PLATFORM = "macos";
@ -316,8 +318,8 @@ namespace musik { namespace core { namespace sdk {
curl_easy_getinfo(this->curl, CURLINFO_RESPONSE_CODE, &httpStatus);
if (this->cancel) {
if (this->canceledCallback) {
this->canceledCallback(this);
if (this->canceledCb) {
this->canceledCb(this);
}
}

View File

@ -45,7 +45,9 @@
namespace musik {
namespace cube {
static inline std::string userAgent() {
#ifdef WIN32
#ifdef _WIN64
static const std::string PLATFORM = "win64";
#elif WIN32
static const std::string PLATFORM = "win32";
#elif defined __APPLE__
static const std::string PLATFORM = "macos";

View File

@ -61,7 +61,9 @@ static const std::string MINOR = "minor";
static const std::string PATCH = "patch";
static const std::string URL = "url";
#ifdef WIN32
#ifdef _WIN64
static const std::string PLATFORM = "win64";
#elif WIN32
static const std::string PLATFORM = "win32";
#elif defined __APPLE__
static const std::string PLATFORM = "macos";