From 2d36d7344a85d0895d0f8894a7412d10e5ff0c8a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 15 May 2021 22:51:33 +0200 Subject: Fix manganelo id for manga with <= 2 characters, force redraw manga image after 1 second --- src/QuickMedia.cpp | 8 ++++++++ src/plugins/Manganelo.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 755b5b2..cd4a279 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2782,6 +2782,8 @@ namespace QuickMedia { malloc_trim(0); + sf::Clock force_redraw_timer; + // TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped) while (current_page == PageType::IMAGES && window.isOpen()) { while(window.pollEvent(event)) { @@ -2848,6 +2850,12 @@ namespace QuickMedia { content_size.x = window_size.x; content_size.y = window_size.y - bottom_panel_height; + // TODO: Track x11 window damage instead + if(force_redraw_timer.getElapsedTime().asSeconds() >= 1.0f) { + force_redraw_timer.restart(); + redraw = true; + } + if(redraw) { redraw = false; if(error) { diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp index 960caaf..5e53451 100644 --- a/src/plugins/Manganelo.cpp +++ b/src/plugins/Manganelo.cpp @@ -163,7 +163,7 @@ namespace QuickMedia { } manga_id = url.substr(index + 6); - if(manga_id.size() <= 2) { + if(manga_id.empty()) { std::string err_msg = "Url "; err_msg += url; err_msg += " doesn't contain manga id"; -- cgit v1.2.3