From 4db0876f45533d3b55ee79df2d2bc78b789b5a28 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 13 Apr 2021 09:09:30 +0200 Subject: Make search fuzzy, fix soundcloud next song when hitting user Also some other misc changes --- src/plugins/NyaaSi.cpp | 8 ++++++-- src/plugins/Youtube.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp index c005b31..7a84346 100644 --- a/src/plugins/NyaaSi.cpp +++ b/src/plugins/NyaaSi.cpp @@ -288,7 +288,9 @@ namespace QuickMedia { std::string *description = (std::string*)userdata; const char *text = quickmedia_html_node_get_text(node); if(description->empty() && text) { - *description = strip(text); + std::string desc = strip(text); + html_unescape_sequences(desc); + *description = std::move(desc); } }, &description); @@ -360,7 +362,9 @@ namespace QuickMedia { auto *item_data = (BodyItemContext*)userdata; const char *text = quickmedia_html_node_get_text(node); if(text && item_data->index < item_data->body_items->size()) { - (*item_data->body_items)[item_data->index]->set_description(strip(text)); + std::string desc = strip(text); + html_unescape_sequences(desc); + (*item_data->body_items)[item_data->index]->set_description(std::move(desc)); item_data->index++; } }, &body_item_image_context); diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 4add02c..f7d38aa 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -734,7 +734,7 @@ namespace QuickMedia { const Json::Value &author_is_channel_owner_json = comment_renderer_json["authorIsChannelOwner"]; if(author_is_channel_owner_json.isBool() && author_is_channel_owner_json.asBool()) - body_item->set_title_color(sf::Color(150, 255, 150)); + body_item->set_author_color(sf::Color(150, 255, 150)); std::optional comment = yt_json_get_text(comment_renderer_json, "contentText"); if(comment) @@ -779,6 +779,9 @@ namespace QuickMedia { } PluginResult YoutubeCommentsPage::lazy_fetch(BodyItems &result_items) { + if(continuation_token.empty()) + return PluginResult::OK; + std::string next_url = "https://www.youtube.com/comment_service_ajax?action_get_comments=1&pbj=1&ctoken="; next_url += url_param_encode(continuation_token); //next_url += "&continuation="; @@ -858,6 +861,9 @@ namespace QuickMedia { } PluginResult YoutubeCommentRepliesPage::lazy_fetch(BodyItems &result_items) { + if(continuation_token.empty()) + return PluginResult::OK; + std::string next_url = "https://www.youtube.com/comment_service_ajax?action_get_comment_replies=1&pbj=1&ctoken="; next_url += url_param_encode(continuation_token); //next_url += "&continuation="; -- cgit v1.2.3-70-g09d2