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>
pull/2482/head
copilot-swe-agent[bot] 3 days ago committed by GitHub
parent 33c09e5c0e
commit 069e3d4e3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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,

Loading…
Cancel
Save