From 85629da7eea972d96c5433191fc43125811cc7a0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 14 Feb 2022 00:44:26 +0100 Subject: Remove mangadex upgrade code --- src/plugins/Mangadex.cpp | 56 ------------------------------------------------ 1 file changed, 56 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index 6aa73b0..2efd2f1 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -4,62 +4,6 @@ #include namespace QuickMedia { - PluginResult legacy_mangadex_id_to_new_manga_id(Page *page, const std::vector &manga_ids, std::vector> &new_manga_ids) { - Json::Value request_json(Json::objectValue); - request_json["type"] = "manga"; - Json::Value manga_ids_json(Json::arrayValue); - for(int manga_id : manga_ids) { - manga_ids_json.append(manga_id); - } - request_json["ids"] = std::move(manga_ids_json); - - Json::StreamWriterBuilder json_builder; - json_builder["commentStyle"] = "None"; - json_builder["indentation"] = ""; - - std::vector additional_args = { - { "-X", "POST" }, - { "-H", "content-type: application/json" }, - { "--data-binary", Json::writeString(json_builder, request_json) } - }; - - Json::Value json_root; - if(page->download_json(json_root, "https://api.mangadex.org/legacy/mapping", std::move(additional_args), true) != DownloadResult::OK) - return PluginResult::NET_ERR; - - if(!json_root.isArray()) - return PluginResult::OK; - - for(const Json::Value &result_item_json : json_root) { - if(!result_item_json.isObject()) - continue; - - const Json::Value &result_json = result_item_json["result"]; - if(!result_json.isString() || strcmp(result_json.asCString(), "ok") != 0) - continue; - - const Json::Value &data_json = result_item_json["data"]; - if(!data_json.isObject()) - continue; - - const Json::Value &attributes_json = data_json["attributes"]; - if(!attributes_json.isObject()) - continue; - - const Json::Value &legacy_id_json = attributes_json["legacyId"]; - if(!legacy_id_json.isInt()) - continue; - - const Json::Value &new_id_json = attributes_json["newId"]; - if(!new_id_json.isString()) - continue; - - new_manga_ids.push_back(std::make_pair(legacy_id_json.asInt(), new_id_json.asString())); - } - - return PluginResult::OK; - } - static std::string relationships_get_cover_art_filename(const Json::Value &relationships_json) { std::string result; if(!relationships_json.isArray()) -- cgit v1.2.3