diff options
Diffstat (limited to 'src/plugins/Soundcloud.cpp')
-rw-r--r-- | src/plugins/Soundcloud.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/Soundcloud.cpp b/src/plugins/Soundcloud.cpp index 6740504..90fe144 100644 --- a/src/plugins/Soundcloud.cpp +++ b/src/plugins/Soundcloud.cpp @@ -3,7 +3,6 @@ #include "../../include/StringUtils.hpp" #include "../../include/Scale.hpp" #include <quickmedia/HtmlSearch.h> -#include <thread> namespace QuickMedia { static std::string client_id; @@ -300,14 +299,14 @@ namespace QuickMedia { if(result != 0) return PluginResult::ERR; - std::vector<std::future<std::string>> async_download_threads; + async_download_threads.clear(); for(std::string &script_source : script_sources) { if(string_starts_with(script_source, "//")) script_source = "https://" + script_source.substr(2); else if(string_starts_with(script_source, "/")) script_source = "https://soundcloud.com/" + script_source.substr(1); - async_download_threads.push_back(std::async(std::launch::async, [script_source]() -> std::string { + async_download_threads.push_back(AsyncTask<std::string>([script_source]() -> std::string { std::string website_data; DownloadResult download_result = download_to_string(script_source, website_data, {}, true); if(download_result != DownloadResult::OK) return ""; |