feat(bulk-upload): add bulkTitleFromFilename utility

Converts a raw filename into a human-readable title candidate by
stripping the extension and replacing underscore/hyphen runs with spaces.
Reuses the existing stripExtension() helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-24 16:30:12 +02:00
committed by marcel
parent 69c739c6e3
commit f76af8c678
2 changed files with 23 additions and 1 deletions

View File

@@ -81,3 +81,7 @@ export function parseFilename(filename: string): FilenameParseResult {
export function stripExtension(filename: string): string {
return filename.replace(/\.[^/.]+$/, '');
}
export function bulkTitleFromFilename(filename: string): string {
return stripExtension(filename).replace(/[_-]+/g, ' ').trim();
}