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:
parent
b2e4f2d45e
commit
17b10edbbc
4
main.js
4
main.js
@ -296,7 +296,9 @@ ipcMain.handle('begin-mapping', async (event, { directory, files, tvdbId }) => {
|
|||||||
|
|
||||||
// Extract clean show name (without tvdbid bracket if present)
|
// Extract clean show name (without tvdbid bracket if present)
|
||||||
// Matches [tvdbid-XXXXX] or [tvdbid-series-XXXXX] formats
|
// 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)
|
// Rename each file first (using original paths)
|
||||||
let successCount = 0;
|
let successCount = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user