From 041696ab8513e1aecc3e1c95598644dac150fc88 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 11 Mar 2021 00:38:10 +0100 Subject: Youtube: fix comments not updating when going to the next video --- src/plugins/Youtube.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index ade73ff..c31a0c3 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -748,10 +748,14 @@ namespace QuickMedia { } const Json::Value &reply_count_json = comment_renderer_json["replyCount"]; - if(reply_count_json.isInt64()) { + if(reply_count_json.isInt64() && reply_count_json.asInt64() > 0) { if(!description.empty()) description += '\n'; - description += std::to_string(reply_count_json.asInt64()) + " replies"; + + if(reply_count_json.asInt64() == 1) + description += "1 reply"; + else + description += std::to_string(reply_count_json.asInt64()) + " replies"; } std::string hearted_tooltip = comment_renderer_get_hearted_tooltip(comment_renderer_json); @@ -1178,6 +1182,8 @@ namespace QuickMedia { return result_items; std::unordered_set added_videos; + xsrf_token.clear(); + comments_continuation_token.clear(); for(const Json::Value &json_item : json_root) { if(!json_item.isObject()) -- cgit v1.2.3