From 2d40a340ea0e8d61a5f4efcae9cd3c38f00a7f75 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 17 Dec 2025 21:58:36 +0700 Subject: [PATCH] refac use comment_comments for comment count update --- backend/video/src/comments.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/video/src/comments.py b/backend/video/src/comments.py index 4b145a75..d72ead6c 100644 --- a/backend/video/src/comments.py +++ b/backend/video/src/comments.py @@ -142,14 +142,13 @@ class Comments: def upload_comments(self): """upload comments to es""" - if not self.is_activated: - return - print(f"{self.youtube_id}: upload comments") _, _ = ElasticWrap(self.es_path).put(self.json_data) vid_path = f"ta_video/_update/{self.youtube_id}" - data = {"doc": {"comment_count": len(self.comments_format)}} + data = { + "doc": {"comment_count": len(self.json_data["comment_comments"])} + } _, _ = ElasticWrap(vid_path).post(data=data) def delete_comments(self):