From f97f67ebd6a9cd3b5a2b7ee295dad7dbb8fb2828 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 29 May 2021 13:22:16 +0200 Subject: Fix scroll position after lazy load on youtube, scroll in room after new message in matrix --- src/plugins/Youtube.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/plugins/Youtube.cpp') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index e4f152f..d164bc5 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -813,11 +813,9 @@ namespace QuickMedia { } std::optional vote_count = yt_json_get_text(comment_renderer_json, "voteCount"); - if(vote_count) { - if(!description.empty()) - description += '\n'; - description += "👍 " + vote_count.value(); - } + if(!description.empty()) + description += '\n'; + description += "👍 " + vote_count.value_or("0"); const Json::Value &reply_count_json = comment_renderer_json["replyCount"]; if(reply_count_json.isInt64() && reply_count_json.asInt64() > 0) { -- cgit v1.2.3