mirror of
https://github.com/dergigi/boris.git
synced 2026-01-31 12:44:37 +01:00
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
This commit is contained in:
@@ -210,8 +210,10 @@ const VideoView: React.FC<VideoViewProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user