aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-12-22 02:57:30 +0100
committerdec05eba <dec05eba@protonmail.com>2019-12-22 02:57:30 +0100
commit6d4fba24f82ddc8c96f9296bc1319826c29e1e34 (patch)
tree63d79fb0300abcf50f436fbf74749fb6e409e9d9 /src
parent5a8f12a1b229cc184eb5ef283830d9c33bcf2b00 (diff)
Fix manganelo not showing any pages
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp10
-rw-r--r--src/plugins/Manganelo.cpp6
2 files changed, 12 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 557370a..ebb367f 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -407,8 +407,10 @@ namespace QuickMedia {
search_bar->onTextSubmitCallback = [this, &tabs, &selected_tab](const std::string &text) -> bool {
Page next_page = current_plugin->get_page_after_search();
// TODO: This shouldn't be done if search_selected_suggestion fails
- if(search_selected_suggestion(tabs[selected_tab].body, body, current_plugin, content_title, content_url) != SearchResult::OK)
+ if(search_selected_suggestion(tabs[selected_tab].body, body, current_plugin, content_title, content_url) != SearchResult::OK) {
+ show_notification("Search", "Search failed!", Urgency::CRITICAL);
return false;
+ }
if(next_page == Page::EPISODE_LIST) {
if(content_url.empty()) {
@@ -1091,7 +1093,11 @@ namespace QuickMedia {
download_chapter_images_if_needed(image_plugin);
int num_images = 0;
- image_plugin->get_number_of_images(images_url, num_images);
+ if(image_plugin->get_number_of_images(images_url, num_images) != ImageResult::OK) {
+ show_notification("Plugin", "Failed to get number of images", Urgency::CRITICAL);
+ current_page = Page::EPISODE_LIST;
+ return;
+ }
image_index = std::min(image_index, num_images);
if(image_index < num_images) {
diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp
index 5224ada..2b69e62 100644
--- a/src/plugins/Manganelo.cpp
+++ b/src/plugins/Manganelo.cpp
@@ -13,7 +13,7 @@ namespace QuickMedia {
if(result != 0)
goto cleanup;
- result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='chapter-list']/div[class='row']//a",
+ result = quickmedia_html_find_nodes_xpath(&html_search, "//ul[class='row-content-chapter']//a",
[](QuickMediaHtmlNode *node, void *userdata) {
auto *item_data = (BodyItems*)userdata;
const char *href = quickmedia_html_node_get_attribute_value(node, "href");
@@ -119,7 +119,7 @@ namespace QuickMedia {
if(result != 0)
goto cleanup;
- result = quickmedia_html_find_nodes_xpath(&html_search, "//div[id='vungdoc']/img",
+ result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='container-chapter-reader']//img",
[](QuickMediaHtmlNode *node, void *userdata) {
auto *urls = (std::vector<std::string>*)userdata;
const char *src = quickmedia_html_node_get_attribute_value(node, "src");
@@ -135,6 +135,8 @@ namespace QuickMedia {
quickmedia_html_search_deinit(&html_search);
if(result == 0)
last_chapter_url = url;
+ if(last_chapter_image_urls.empty())
+ return ImageResult::ERR;
return result == 0 ? ImageResult::OK : ImageResult::ERR;
}