Fix show name extraction to remove leading semicolons

- Add regex to strip leading semicolons/colons from show folder name
- This fixes filenames like ';Demon Slayer S05E01-03' -> 'Demon Slayer S05E01-03'
This commit is contained in:
Jarian Cottingham 2026-02-25 00:33:07 -06:00
parent b2e4f2d45e
commit 17b10edbbc

View File

@ -296,7 +296,9 @@ ipcMain.handle('begin-mapping', async (event, { directory, files, tvdbId }) => {
// Extract clean show name (without tvdbid bracket if present)
// Matches [tvdbid-XXXXX] or [tvdbid-series-XXXXX] formats
const showName = showFolderName.replace(/\s*\[tvdbid-[^\]]+\]/, '').trim();
// Also removes leading semicolons or other problematic characters
let showName = showFolderName.replace(/\s*\[tvdbid-[^\]]+\]/, '').trim();
showName = showName.replace(/^[;:]+/, '').trim();
// Rename each file first (using original paths)
let successCount = 0;