aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
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/QuickMedia.cpp
parent5a8f12a1b229cc184eb5ef283830d9c33bcf2b00 (diff)
Fix manganelo not showing any pages
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp10
1 files changed, 8 insertions, 2 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) {