From da89ec98fb34757f0c46dc8cb2dd87ae78d317ce Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 10 Oct 2020 10:43:50 +0200 Subject: Refactor: move download->json parsing to a one function --- plugins/Plugin.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index 2cc08cc..438b4ea 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -88,5 +88,10 @@ namespace QuickMedia { bool use_tor = false; protected: std::string url_param_encode(const std::string ¶m) const; + DownloadResult download_json(Json::Value &result, const std::string &url, std::vector additional_args, bool use_browser_useragent = false, std::string *err_msg = nullptr) const; + SuggestionResult download_result_to_suggestion_result(DownloadResult download_result) const { return (SuggestionResult)download_result; } + PluginResult download_result_to_plugin_result(DownloadResult download_result) const { return (PluginResult)download_result; } + SearchResult download_result_to_search_result(DownloadResult download_result) const { return (SearchResult)download_result; } + ImageResult download_result_to_image_result(DownloadResult download_result) const { return (ImageResult)download_result; } }; } \ No newline at end of file -- cgit v1.2.3