From b95298d79eee764c48dfec9d329026548392484c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 Sep 2020 15:59:51 +0200 Subject: Revert back to non quick search and without description for mangadex --- src/plugins/Mangadex.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index 705cbc5..6a8f8a7 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -172,7 +172,7 @@ namespace QuickMedia { if(!get_rememberme_token(rememberme_token)) return SuggestionResult::ERR; - std::string url = "https://mangadex.org/quick_search/"; + std::string url = "https://mangadex.org/search?title="; url += url_param_encode(text); CommandArg cookie_arg = { "-H", "cookie: mangadex_rememberme_token=" + rememberme_token }; @@ -217,18 +217,18 @@ namespace QuickMedia { if(result != 0) goto cleanup; - body_item_image_context.index = 0; - result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='pl-1']", - [](QuickMediaHtmlNode *node, void *userdata) { - auto *item_data = (BodyItemImageContext*)userdata; - const char *text = quickmedia_html_node_get_text(node); - if(text && item_data->index < item_data->body_items->size()) { - std::string desc = strip(text); - std::replace_if(desc.begin(), desc.end(), [](int c) { return c == '\n'; }, ' '); - (*item_data->body_items)[item_data->index]->set_description(std::move(desc)); - item_data->index++; - } - }, &body_item_image_context); + // body_item_image_context.index = 0; + // result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='pl-1']", + // [](QuickMediaHtmlNode *node, void *userdata) { + // auto *item_data = (BodyItemImageContext*)userdata; + // const char *text = quickmedia_html_node_get_text(node); + // if(text && item_data->index < item_data->body_items->size()) { + // std::string desc = strip(text); + // std::replace_if(desc.begin(), desc.end(), [](int c) { return c == '\n'; }, ' '); + // (*item_data->body_items)[item_data->index]->set_description(std::move(desc)); + // item_data->index++; + // } + // }, &body_item_image_context); cleanup: quickmedia_html_search_deinit(&html_search); -- cgit v1.2.3