From 069e3d4e3d93721ea8c83bfb1644a5e50a769d82 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:03:50 +0000 Subject: [PATCH] fix: address code review - deduplicate title slice, improve thread ID uniqueness Agent-Logs-Url: https://github.com/thaitien280401-stack/RedditVideoMakerBot/sessions/b3d8248e-4f90-4f82-baef-11a251967a3b Co-authored-by: thaitien280401-stack <271128961+thaitien280401-stack@users.noreply.github.com> --- threads/threads_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/threads/threads_client.py b/threads/threads_client.py index 4f7f36d..e537d6f 100644 --- a/threads/threads_client.py +++ b/threads/threads_client.py @@ -451,8 +451,11 @@ def _get_google_trends_content( content: dict = { "thread_url": thread_url, - "thread_title": display_title[:_MAX_TITLE_LENGTH], - "thread_id": re.sub(r"[^\w\s-]", "", shortcode or thread_text[:20]), + "thread_title": display_title, + "thread_id": re.sub( + r"[^\w\s-]", "", + shortcode or f"gtrends_{hash(thread_text) % 10**8}", + ), "thread_author": f"@{thread_username}", "is_nsfw": False, "thread_post": thread_text,