From eaa29234870703ada1b63a357d9d9d0fdaea653f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 27 Sep 2023 23:51:59 +0200 Subject: Comma separate invidious feed views --- src/plugins/Youtube.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 474d3a2..7248348 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -971,8 +971,10 @@ namespace QuickMedia { std::string video_id_str = video_id_json.asString(); auto body_item = BodyItem::create(title_json.asString()); std::string desc; - if(view_count_json.isInt64()) - desc += std::to_string(view_count_json.asInt64()) + " view" + (view_count_json.asInt64() == 1 ? "" : "s"); + if(view_count_json.isInt64()) { + std::string views = number_separate_thousand_commas(std::to_string(view_count_json.asInt64())); + desc += views + " view" + (view_count_json.asInt64() == 1 ? "" : "s"); + } if(published_text_json.isString()) { if(!desc.empty()) desc += " • "; -- cgit v1.2.3