changed what a post title is with telegram chat creation

This commit is contained in:
2026-02-19 20:38:23 +01:00
parent c7cdebcd5d
commit dd8b4e4c6e

View File

@@ -420,11 +420,16 @@ class TelegramService:
strategy_weight=post_type.strategy_weight, strategy_weight=post_type.strategy_weight,
) )
# Use first sentence of generated post as title
first_sentence = post_content.split("\n")[0].strip()
if not first_sentence:
first_sentence = post_content[:100].strip()
# Save the post to DB (status=draft, no critic data) # Save the post to DB (status=draft, no critic data)
from src.database.models import GeneratedPost from src.database.models import GeneratedPost
saved = await db.save_generated_post(GeneratedPost( saved = await db.save_generated_post(GeneratedPost(
user_id=user_uuid, user_id=user_uuid,
topic_title=topic_text[:200], topic_title=first_sentence[:200],
post_content=post_content, post_content=post_content,
iterations=1, iterations=1,
writer_versions=[post_content], writer_versions=[post_content],