aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/NyaaSi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/NyaaSi.cpp')
-rw-r--r--src/plugins/NyaaSi.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp
index 0d43810..2ecf0d3 100644
--- a/src/plugins/NyaaSi.cpp
+++ b/src/plugins/NyaaSi.cpp
@@ -84,6 +84,12 @@ namespace QuickMedia {
const std::string category_id_tag_end = "</nyaa:categoryId>";
const std::string size_tag_begin = "<nyaa:size>";
const std::string size_tag_end = "</nyaa:size>";
+ const std::string comments_tag_begin = "<nyaa:comments>";
+ const std::string comments_tag_end = "</nyaa:comments>";
+ const std::string trusted_tag_begin = "<nyaa:trusted>";
+ const std::string trusted_tag_end = "</nyaa:trusted>";
+ const std::string remake_tag_begin = "<nyaa:remake>";
+ const std::string remake_tag_end = "</nyaa:remake>";
size_t index = 0;
while(index < website_data.size()) {
@@ -105,6 +111,9 @@ namespace QuickMedia {
std::string downloads = get_rss_item_text(website_data, index, item_end, downloads_tag_begin, downloads_tag_end);
std::string category_id = get_rss_item_text(website_data, index, item_end, category_id_tag_begin, category_id_tag_end);
std::string size = get_rss_item_text(website_data, index, item_end, size_tag_begin, size_tag_end);
+ std::string comments = get_rss_item_text(website_data, index, item_end, comments_tag_begin, comments_tag_end);
+ std::string trusted = get_rss_item_text(website_data, index, item_end, trusted_tag_begin, trusted_tag_end);
+ std::string remake = get_rss_item_text(website_data, index, item_end, remake_tag_begin, remake_tag_end);
if(title.empty() || link.empty() || pub_date.empty() || seeders.empty() || leechers.empty() || downloads.empty() || category_id.empty() || size.empty()) {
fprintf(stderr, "Error: failed to parse nyaa.si rss items\n");
@@ -114,7 +123,11 @@ namespace QuickMedia {
auto body_item = std::make_unique<BodyItem>(std::move(title));
body_item->url = std::move(link);
body_item->thumbnail_url = "https://nyaa.si/static/img/icons/nyaa/" + category_id + ".png";
- body_item->set_description("Published: " + pub_date + "\nSeeders: " + seeders + "\nLeechers: " + leechers + "\nDownloads: " + downloads + "\nSize: " + size);
+ body_item->set_description("Published: " + pub_date + "\nSeeders: " + seeders + "\nLeechers: " + leechers + "\nDownloads: " + downloads + "\nSize: " + size + "\nComments: " + comments);
+ if(trusted == "Yes")
+ body_item->background_color = sf::Color(43, 95, 47);
+ else if(remake == "Yes")
+ body_item->background_color = sf::Color(93, 45, 47);
result_items.push_back(std::move(body_item));
index = item_end + 7;