aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-01-19 23:47:37 +0100
committerdec05eba <dec05eba@protonmail.com>2023-01-19 23:47:37 +0100
commit760d903fe7c7c56a6408accff0daa47c2e743eed (patch)
treedcd3f9aeb64f168c2a63afeba8c170e61e588618 /src/plugins
parent4abcb3755bb222f91ccbf7b65f6da181cfd4d319 (diff)
Lazy fetch local anime page
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/LocalAnime.cpp5
-rw-r--r--src/plugins/NyaaSi.cpp5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp
index 6337adf..14329cc 100644
--- a/src/plugins/LocalAnime.cpp
+++ b/src/plugins/LocalAnime.cpp
@@ -336,6 +336,11 @@ namespace QuickMedia {
}
PluginResult LocalAnimeSearchPage::lazy_fetch(BodyItems &result_items) {
+ if(fetch_home_page) {
+ fetch_home_page = false;
+ anime_items = get_anime_in_directory(get_config().local_anime.directory);
+ }
+
std::unordered_map<std::string, WatchProgress> watch_progress = get_watch_progress_for_plugin("local-anime");
const time_t time_now = time(nullptr);
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp
index 739032b..d0bc616 100644
--- a/src/plugins/NyaaSi.cpp
+++ b/src/plugins/NyaaSi.cpp
@@ -463,6 +463,7 @@ namespace QuickMedia {
result_items.push_back(std::move(body_item));
}
+ html_unescape_sequences(title);
result_items.front()->set_title(title);
result = quickmedia_html_find_nodes_xpath(&html_search, "//div[id='torrent-description']",
@@ -513,7 +514,9 @@ namespace QuickMedia {
QuickMediaStringView href = quickmedia_html_node_get_attribute_value(node->node, "href");
QuickMediaStringView text = quickmedia_html_node_get_text(node);
if(href.data && text.data && href.size >= 6 && memcmp(href.data, "/user/", 6) == 0) {
- auto body_item = BodyItem::create(std::string(text.data, text.size));
+ std::string title(text.data, text.size);
+ html_unescape_sequences(title);
+ auto body_item = BodyItem::create(std::move(title));
//body_item->url = "https://nyaa.si/" + std::string(href);
item_data->push_back(std::move(body_item));
}