aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-06-27 14:58:49 +0200
committerdec05eba <dec05eba@protonmail.com>2023-06-27 22:27:09 +0200
commit08e1a601e4aa13cdfb3bea836b89524cc13b07bf (patch)
tree49e4d5f1c14861336ef0324d2fb43eb5b9dff372 /src/plugins
parent497d9733e95ae6dadbc0f5d811153bac9b75620e (diff)
Fix nyaa default avatar
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>&) {