From 9d4879215bb7b3b89122a930f86248cc405536a1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 13 Sep 2020 17:47:51 +0200 Subject: Add description to mangadex search result, add youtube timestamp --- include/Body.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/Body.hpp') diff --git a/include/Body.hpp b/include/Body.hpp index db502c5..c487ad9 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -19,6 +19,7 @@ namespace QuickMedia { BodyItem(const BodyItem &other) { title = other.title; + description = other.description; url = other.url; thumbnail_url = other.thumbnail_url; attached_content_url = other.attached_content_url; @@ -29,6 +30,10 @@ namespace QuickMedia { title_text = std::make_unique(*other.title_text); else title_text = nullptr; + if(other.description_text) + description_text = std::make_unique(*other.description_text); + else + description_text = nullptr; replies = other.replies; post_number = other.post_number; } @@ -38,7 +43,14 @@ namespace QuickMedia { dirty = true; } - std::string title; + void set_description(std::string new_description) { + description = std::move(new_description); + } + + const std::string& get_title() const { return title; } + const std::string& get_description() const { return description; } + + // TODO: Use a list of strings instead, not all plugins need all of these fields std::string url; std::string thumbnail_url; std::string attached_content_url; @@ -46,9 +58,13 @@ namespace QuickMedia { bool visible; bool dirty; std::unique_ptr title_text; + std::unique_ptr description_text; // Used by image boards for example. The elements are indices to other body items std::vector replies; std::string post_number; + private: + std::string title; + std::string description; }; using BodyItems = std::vector>; -- cgit v1.2.3