aboutsummaryrefslogtreecommitdiff
path: root/include/Body.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-13 17:47:51 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-13 17:47:51 +0200
commit9d4879215bb7b3b89122a930f86248cc405536a1 (patch)
tree77edfed947acac7b5678b4321a8bf9ad37b7fd3b /include/Body.hpp
parentf06b60a9f8beb0d79a6d427b49e4634fe77f45db (diff)
Add description to mangadex search result, add youtube timestamp
Diffstat (limited to 'include/Body.hpp')
-rw-r--r--include/Body.hpp18
1 files changed, 17 insertions, 1 deletions
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<Text>(*other.title_text);
else
title_text = nullptr;
+ if(other.description_text)
+ description_text = std::make_unique<Text>(*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<Text> title_text;
+ std::unique_ptr<Text> description_text;
// Used by image boards for example. The elements are indices to other body items
std::vector<size_t> replies;
std::string post_number;
+ private:
+ std::string title;
+ std::string description;
};
using BodyItems = std::vector<std::unique_ptr<BodyItem>>;