shenwei356/brename

Skip errors

tspivey opened this issue · 4 comments

If I'm renaming a lot of files, I don't want a few errors to stop the process. I would like an option which just skips those renames, and continues renaming files.

What kind of errors to skip, show some examples please.

brename is use to safely renaming files, so it's designed to escaping any error.

I would like to skip the errors about nonexistent files. For example, with these files:

01 Track 1.mp3
01_Track_1.mp3
02_Track_2.mp3

Running:
brename -v2 -p '_' -r ' ' music

Produces this error:

[ERRO] checking: [ new path existed ] 'music/01_Track_1.mp3' -> 'music/01 Track 1.mp3'
[ERRO] 1 potential error(s) detected, please check

In this case, I would like an option to just rename what it can without overwriting the existing files.
At the end of this I would have:

01 Track 1.mp3
01_Track_1.mp3
02 Track 2.mp3

Check v2.6.0

$ brename -v2 -p '_' -r ' ' --overwrite-mode 2 
[WARN] checking: [ new path existed ] '01_Track_1.mp3' -> '01 Track 1.mp3' (will NOT be overwrited)
[INFO] 1 path(s) to be renamed
[INFO] renamed: '02_Track_2.mp3' -> '02 Track 2.mp3'
[INFO] 1 path(s) renamed