From 2a973ff9402dab9d6c751a146a9f83617d0e5211 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 23 Oct 2020 10:25:08 +0200 Subject: Matrix: start on room tags, fix thread race condition on accessing room variables (name, avatar url, prev batch) --- plugins/Page.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'plugins/Page.hpp') diff --git a/plugins/Page.hpp b/plugins/Page.hpp index 2e85cad..de80b4f 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -9,6 +9,14 @@ namespace QuickMedia { constexpr int SEARCH_DELAY_FILTER = 50; + // TODO: Remove to PageType when the other PageType is removed + enum class PageTypez { + REGULAR, + MANGA_IMAGES, + IMAGE_BOARD_THREAD, + VIDEO + }; + class Page { public: Page(Program *program) : program(program) {} @@ -29,10 +37,8 @@ namespace QuickMedia { DownloadResult download_json(Json::Value &result, const std::string &url, std::vector additional_args, bool use_browser_useragent = false, std::string *err_msg = nullptr); - virtual bool is_manga_images_page() const { return false; } - virtual bool is_image_board_thread_page() const { return false; } - virtual bool is_video_page() const { return false; } - // Mutually exclusive with |is_manga_images_page|, |is_image_board_thread_page| and |is_video_page| + virtual PageTypez get_type() const { return PageTypez::REGULAR; } + // Mutually exclusive with |get_type| when |get_type| is not PageTypez::REGULAR virtual bool is_single_page() const { return false; } virtual bool is_trackable() const { return false; } virtual bool is_lazy_fetch_page() const { return false; } -- cgit v1.2.3