diff --git a/CMakeLists.txt b/CMakeLists.txt index c71bd8869..57aed3d8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.0) project(musikcube) set (musikcube_VERSION_MAJOR 0) set (musikcube_VERSION_MINOR 96) -set (musikcube_VERSION_PATCH 0) +set (musikcube_VERSION_PATCH 1) set (musikcube_VERSION "${musikcube_VERSION_MAJOR}.${musikcube_VERSION_MINOR}.${musikcube_VERSION_PATCH}") list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake) diff --git a/musikcube.spec b/musikcube.spec index f8d2f84e4..8240552dd 100644 --- a/musikcube.spec +++ b/musikcube.spec @@ -1,6 +1,6 @@ %define name musikcube %define build_timestamp %{lua: print(os.date("%Y%m%d"))} -%define version 0.96.0 +%define version 0.96.1 Name: %{name} Version: %{version} Release: %{dist} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1a6f76c19..6a722c049 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: musikcube # you probably want to 'snapcraft register ' -version: 0.96.0 +version: 0.96.1 summary: a terminal-based music player, metadata indexer, and server description: | musikcube is a fully functional terminal-based music player, library, and diff --git a/src/musikcore/sdk/HttpClient.h b/src/musikcore/sdk/HttpClient.h index b7516f8de..ff4cb2dce 100644 --- a/src/musikcore/sdk/HttpClient.h +++ b/src/musikcore/sdk/HttpClient.h @@ -85,6 +85,10 @@ namespace musik { namespace core { namespace sdk { static size_t CurlWriteCallback(char *ptr, size_t size, size_t nmemb, void *userdata); static int CurlTransferCallback(void *ptr, curl_off_t downTotal, curl_off_t downNow, curl_off_t upTotal, curl_off_t upNow); static size_t CurlHeaderCallback(char *buffer, size_t size, size_t nitems, void *userdata); +#if LIBCURL_VERSION_NUM < 0x072000 + static int LegacyCurlTransferCallback(void* ptr, double downTotal, double downNow, double upTotal, double upNow); +#endif + static std::string DefaultUserAgent(); static void ReplaceAll(std::string& input, const std::string& find, const std::string& replace); @@ -160,6 +164,20 @@ namespace musik { namespace core { namespace sdk { return 0; /* ok! */ } +#if LIBCURL_VERSION_NUM < 0x072000 + template + int HttpClient::LegacyCurlTransferCallback( + void* ptr, double downTotal, double downNow, double upTotal, double upNow) + { + return CurlTransferCallback( + ptr, + (curl_off_t)downTotal, + (curl_off_t)downNow, + (curl_off_t)upTotal, + (curl_off_t)upNow); + } +#endif + template /* copied from Common.h for SDK usage. */ void HttpClient::ReplaceAll(std::string& input, const std::string& find, const std::string& replace) { size_t pos = input.find(find); @@ -251,11 +269,17 @@ namespace musik { namespace core { namespace sdk { curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &CurlWriteCallback); - curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this); - curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &CurlTransferCallback); curl_easy_setopt(curl, CURLOPT_HEADERDATA, this); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, &CurlHeaderCallback); +#if LIBCURL_VERSION_NUM < 0x072000 + curl_easy_setopt(this->curlEasy, CURLOPT_PROGRESSDATA, this); + curl_easy_setopt(this->curlEasy, CURLOPT_PROGRESSFUNCTION, &LegacyCurlTransferCallback); +#else + curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &CurlTransferCallback); +#endif + #if 0 curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost"); curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080); diff --git a/src/musikcore/version.h b/src/musikcore/version.h index 1e30be1da..55af742ad 100644 --- a/src/musikcore/version.h +++ b/src/musikcore/version.h @@ -38,9 +38,9 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 96 -#define VERSION_PATCH 0 -#define VERSION_COMMIT_HASH "#ad09b30b" -#define VERSION "0.96.0" +#define VERSION_PATCH 1 +#define VERSION_COMMIT_HASH "#ffee32e2" +#define VERSION "0.96.1" namespace musik { namespace cube { diff --git a/src/musikcube/musikcube.rc b/src/musikcube/musikcube.rc index 0d47e86a1..2d983becb 100644 Binary files a/src/musikcube/musikcube.rc and b/src/musikcube/musikcube.rc differ