From 15708005417840782f7cafeee99d50fc112d49f6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 12 Feb 2022 16:29:08 +0100 Subject: Local-manga: fix cache not utilized properly --- src/plugins/LocalManga.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/LocalManga.cpp b/src/plugins/LocalManga.cpp index dc98639..ed0f1b2 100644 --- a/src/plugins/LocalManga.cpp +++ b/src/plugins/LocalManga.cpp @@ -16,6 +16,11 @@ namespace QuickMedia { public: static CoverPageLinkCache& get_instance() { static CoverPageLinkCache instance; + if(instance.initialized) + return instance; + + instance.initialized = true; + Path dir = get_cache_dir().join("thumbnail-link"); if(create_directory_recursive(dir) != 0) { show_notification("QuickMedia", "Failed to create directory: " + dir.data, Urgency::CRITICAL); @@ -67,6 +72,7 @@ namespace QuickMedia { private: std::unordered_map manga_name_base64_to_cover_filepath_map; Path cache_filepath; + bool initialized = false; }; static const mgl::Color finished_reading_color = mgl::Color(43, 255, 47); -- cgit v1.2.3