diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-06 18:46:28 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-06 18:46:28 +0200 |
commit | ecb76941fe38cb8016388f6b2185312432cc8122 (patch) | |
tree | 99d909b53f7216583e17b7ddcae60844603358f1 /plugins | |
parent | 75ca528807ae0eb77d3d11ab6075e256d0bfadd2 (diff) |
Upgrade mangadex api to the new one
There is a bug in mangadex api where order[publishAt]=desc is ignored,
so going to the next chapter is messed up. Automedia will be updated
after this is fixed. Also manga cover images are missing.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Mangadex.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/Mangadex.hpp b/plugins/Mangadex.hpp index 8e32aab..1bed70c 100644 --- a/plugins/Mangadex.hpp +++ b/plugins/Mangadex.hpp @@ -4,6 +4,8 @@ #include <functional> namespace QuickMedia { + PluginResult legacy_mangadex_id_to_new_manga_id(Page *page, const std::vector<int> &manga_ids, std::vector<std::pair<int, std::string>> &new_manga_ids); + class MangadexSearchPage : public Page { public: MangadexSearchPage(Program *program) : Page(program) {} @@ -23,6 +25,7 @@ namespace QuickMedia { public: MangadexChaptersPage(Program *program, std::string manga_name, std::string manga_url) : MangaChaptersPage(program, std::move(manga_name), std::move(manga_url)) {} PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override; protected: bool extract_id_from_url(const std::string &url, std::string &manga_id) const override; const char* get_service_name() const override { return "mangadex"; } @@ -30,14 +33,12 @@ namespace QuickMedia { class MangadexImagesPage : public MangaImagesPage { public: - MangadexImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url) : MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url)) {} + MangadexImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url, std::vector<std::string> image_urls) : MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url)), image_urls(std::move(image_urls)) {} 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); - bool save_mangadex_cookies(const std::string &url, const std::string &cookie_filepath); + std::vector<std::string> image_urls; }; }
\ No newline at end of file |