aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-10 10:43:50 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-10 10:55:36 +0200
commitda89ec98fb34757f0c46dc8cb2dd87ae78d317ce (patch)
tree653bd81b2125968c706f5552aaeb7d1b7fdc6d04 /plugins
parent85a1edf8d9c21b830f7ec4a2d42b8e5c1d044845 (diff)
Refactor: move download->json parsing to a one function
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Plugin.hpp5
1 files changed, 5 insertions, 0 deletions
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 &param) const;
+ DownloadResult download_json(Json::Value &result, const std::string &url, std::vector<CommandArg> 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