aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-11 17:51:53 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-11 17:51:53 +0100
commitcc445c60d4806fb462a3efc27bf8d727176f77da (patch)
tree7774f114a333aac896b7405367b35548ceb629d8 /src/plugins
parent515477b5d597b807b27d2f95950b937ab8684c00 (diff)
Fix local manga not updating chapter images when going to next/previous manga (manual removal of cache is needed)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/LocalManga.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/LocalManga.cpp b/src/plugins/LocalManga.cpp
index 3ad4ffa..c39752b 100644
--- a/src/plugins/LocalManga.cpp
+++ b/src/plugins/LocalManga.cpp
@@ -208,9 +208,7 @@ namespace QuickMedia {
return PluginResult::OK;
}
- Path chapter_url = Path(get_config().local_manga_directory).join(content_url).join(args.url);
- std::vector<LocalMangaPage> pages = get_images_in_manga(chapter_url);
- result_tabs.push_back(Tab{nullptr, std::make_unique<LocalMangaImagesPage>(program, content_title, args.title, args.url, thumbnail_url, std::move(pages)), nullptr});
+ result_tabs.push_back(Tab{nullptr, std::make_unique<LocalMangaImagesPage>(program, content_title, args.title, args.url, thumbnail_url), nullptr});
if(is_program_executable_by_name("automedia"))
append_seen_manga_to_automedia_seen(content_url + "/" + args.url);
@@ -241,13 +239,19 @@ namespace QuickMedia {
return ImageResult::OK;
}
- ImageResult LocalMangaImagesPage::get_image_urls_for_chapter(const std::string&) {
+ ImageResult LocalMangaImagesPage::get_image_urls_for_chapter(const std::string &url) {
if(!chapter_image_urls.empty())
return ImageResult::OK;
+ Path chapter_url = Path(get_config().local_manga_directory).join(manga_name).join(url);
+ std::vector<LocalMangaPage> pages = get_images_in_manga(chapter_url);
+ if(pages.empty())
+ return ImageResult::ERR;
+
for(const LocalMangaPage &local_manga_page : pages) {
chapter_image_urls.push_back(local_manga_page.path.data);
}
+
return ImageResult::OK;
}
} \ No newline at end of file