From 1ba58ba74a767a91b28f44eb75db41455adcaa70 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 27 Apr 2021 14:00:35 +0200 Subject: Add authors page for mangakatana and mangatown, attempt to fix image loading getting stuck, misc fixed related to async in plugins --- plugins/Manga.hpp | 2 ++ plugins/MangaCombined.hpp | 2 ++ plugins/MangaGeneric.hpp | 6 +++--- plugins/Mangadex.hpp | 1 + plugins/Manganelo.hpp | 1 + plugins/Soundcloud.hpp | 2 ++ 6 files changed, 11 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/Manga.hpp b/plugins/Manga.hpp index 5dfa800..388ce66 100644 --- a/plugins/Manga.hpp +++ b/plugins/Manga.hpp @@ -37,6 +37,8 @@ namespace QuickMedia { // TODO: Remove and use plugin name instead virtual const char* get_service_name() const = 0; + virtual const char* get_website_url() const = 0; + const std::string manga_name; protected: std::string chapter_name; diff --git a/plugins/MangaCombined.hpp b/plugins/MangaCombined.hpp index b9627fe..56b03ba 100644 --- a/plugins/MangaCombined.hpp +++ b/plugins/MangaCombined.hpp @@ -3,6 +3,7 @@ #include "Manga.hpp" #include #include +#include "../include/AsyncTask.hpp" namespace QuickMedia { struct MangaPlugin { @@ -23,5 +24,6 @@ namespace QuickMedia { sf::Vector2i get_thumbnail_max_size() override { return sf::Vector2i(101, 141); }; private: std::vector search_pages; + std::vector>> search_threads; }; } \ No newline at end of file diff --git a/plugins/MangaGeneric.hpp b/plugins/MangaGeneric.hpp index a03756d..2dca919 100644 --- a/plugins/MangaGeneric.hpp +++ b/plugins/MangaGeneric.hpp @@ -113,9 +113,8 @@ namespace QuickMedia { MangaGenericSearchPage& description_handler(std::vector queries); // This is optional. MangaGenericSearchPage& thumbnail_handler(std::vector queries); - // If |url_contains| is null, then any matching query is added. If |title_field| is "text", then the inner text is used. // This is optional. - MangaGenericSearchPage& authors_handler(const char *html_query, const char *title_field, const char *url_field, const char *url_contains); + MangaGenericSearchPage& authors_handler(std::vector queries); // If |url_contains| is null, then any matching query is added. If |title_field| is "text", then the inner text is used. // This is required. @@ -151,7 +150,7 @@ namespace QuickMedia { std::vector text_queries; std::vector description_queries; std::vector thumbnail_queries; - AuthorsQuery authors_query; + std::vector authors_queries; ListChaptersQuery list_chapters_query; ListPageQuery list_page_query; MangaIdExtractor manga_id_extractor; @@ -192,6 +191,7 @@ namespace QuickMedia { ImageResult get_number_of_images(int &num_images) override; ImageResult for_each_page_in_chapter(PageCallback callback) override; const char* get_service_name() const override { return service_name; } + const char* get_website_url() const override { return website_url.c_str(); } private: ImageResult get_page_image_urls(); private: diff --git a/plugins/Mangadex.hpp b/plugins/Mangadex.hpp index 7fd6ca0..1befa1a 100644 --- a/plugins/Mangadex.hpp +++ b/plugins/Mangadex.hpp @@ -34,6 +34,7 @@ namespace QuickMedia { ImageResult get_number_of_images(int &num_images) override; ImageResult for_each_page_in_chapter(PageCallback callback) override; const char* get_service_name() const override { return "mangadex"; } + const char* get_website_url() const override { return "https://mangadex.org/"; } private: // Cached ImageResult get_image_urls_for_chapter(const std::string &url); diff --git a/plugins/Manganelo.hpp b/plugins/Manganelo.hpp index ca44e05..8e6c2cd 100644 --- a/plugins/Manganelo.hpp +++ b/plugins/Manganelo.hpp @@ -39,6 +39,7 @@ namespace QuickMedia { ImageResult get_number_of_images(int &num_images) override; ImageResult for_each_page_in_chapter(PageCallback callback) override; const char* get_service_name() const override { return "manganelo"; } + const char* get_website_url() const override { return "https://manganelo.com/"; } private: ImageResult get_image_urls_for_chapter(const std::string &url); }; diff --git a/plugins/Soundcloud.hpp b/plugins/Soundcloud.hpp index bb23efb..24dc051 100644 --- a/plugins/Soundcloud.hpp +++ b/plugins/Soundcloud.hpp @@ -1,6 +1,7 @@ #pragma once #include "Page.hpp" +#include "../include/AsyncTask.hpp" namespace QuickMedia { class SoundcloudPage : public Page { @@ -24,6 +25,7 @@ namespace QuickMedia { private: SoundcloudPage submit_page; std::string query_urn; + std::vector> async_download_threads; }; class SoundcloudUserPage : public SoundcloudPage { -- cgit v1.2.3