diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-12 16:29:08 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-12 16:29:08 +0100 |
commit | 15708005417840782f7cafeee99d50fc112d49f6 (patch) | |
tree | 837edc09687b79e196566d39547ae436c25b39c7 | |
parent | 2f9ae9e9462a5a366461f20b4d0c2f4b80ef1b68 (diff) |
Local-manga: fix cache not utilized properly
-rw-r--r-- | src/plugins/LocalManga.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<std::string, std::string> 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); |