diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-27 14:00:35 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-27 14:00:35 +0200 |
commit | 1ba58ba74a767a91b28f44eb75db41455adcaa70 (patch) | |
tree | 5fef40f51fd4fd11966ec58933d10e540fb9fb59 /src/plugins/Soundcloud.cpp | |
parent | 76e1aebbe075287a8297194b38343467c76dd964 (diff) |
Add authors page for mangakatana and mangatown, attempt to fix image loading getting stuck, misc fixed related to async in plugins
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 ""; |