diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/LocalManga.cpp | 12 |
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 |