From 717f09498433adfc2f9d1f7e44829073817d40ee Mon Sep 17 00:00:00 2001 From: Gigi Date: Sat, 25 Oct 2025 00:30:32 +0200 Subject: [PATCH] feat: use note content as title for direct video URLs - Extract first 100 characters of note content as video title - Truncate with ellipsis if content is longer than 100 characters - Fallback to YouTube metadata title or original title if no note content - Improves user experience by showing meaningful titles for direct videos from Nostr notes --- src/components/VideoView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/VideoView.tsx b/src/components/VideoView.tsx index c2665c91..06723e61 100644 --- a/src/components/VideoView.tsx +++ b/src/components/VideoView.tsx @@ -210,8 +210,10 @@ const VideoView: React.FC = ({ } } - const displayTitle = ytMeta?.title || title - // For direct video URLs from Nostr notes, prioritize note content over metadata + // For direct video URLs from Nostr notes, use note content for title and description + const displayTitle = noteContent ? + (noteContent.length > 100 ? noteContent.substring(0, 100).trim() + '...' : noteContent) : + (ytMeta?.title || title) const displaySummary = noteContent || ytMeta?.description || summary const durationText = videoDurationSec !== null ? formatDuration(videoDurationSec) : null