aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/NyaaSi.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp
index 38e3c21..ec2322f 100644
--- a/src/plugins/NyaaSi.cpp
+++ b/src/plugins/NyaaSi.cpp
@@ -535,7 +535,11 @@ namespace QuickMedia {
auto *item_data = (BodyItemContext*)userdata;
QuickMediaStringView src = quickmedia_html_node_get_attribute_value(node->node, "src");
if(src.data && item_data->index < item_data->body_items->size()) {
- (*item_data->body_items)[item_data->index]->thumbnail_url.assign(src.data, src.size);
+ std::string thumbnail_url;
+ if(src.size > 0 && src.data[0] == '/')
+ thumbnail_url += "https://nyaa.si";
+ thumbnail_url.append(src.data, src.size);
+ (*item_data->body_items)[item_data->index]->thumbnail_url = std::move(thumbnail_url);
(*item_data->body_items)[item_data->index]->thumbnail_size = mgl::vec2i(120, 120);
item_data->index++;
}
@@ -578,7 +582,7 @@ namespace QuickMedia {
void NyaaSiSearchPage::set_sort_type(NyaaSiSortType sort_type) {
this->sort_type = sort_type;
title = category_name + " | " + sort_type_names[(size_t)sort_type];
- title.erase(title.end() - 5, title.end()); // Erase emoji character and space at the end. TODO: Remove this when tabs support emojis.
+ title.erase(title.end() - 6, title.end()); // Erase emoji character and space at the end. TODO: Remove this when tabs support emojis.
}
PluginResult NyaaSiSortOrderPage::submit(const SubmitArgs &args, std::vector<Tab>&) {