Conflict Options:
- SKIP (skip existing files)
- OVERRIDE (replace existing files)
- AUTO (replace the existing file if the new file is better)
- INDEX (add index and keep both files)
- FAIL (fail and quit)
--conflict SKIP ... skip files where the destination file paths already exists (default behaviour if --conflict is left unspecified)
Code: Select all
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict SKIP
Skipped [Avatar.2009.mp4] because [Avatar (2009).mp4] already exists
--conflict OVERRIDE ... process files even if the destination file path already exists and replace the existing file (i.e. delete and overwrite)
Code: Select all
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict OVERRIDE
[MOVE] from [Avatar.2009.mp4] to [Avatar (2009).mp4]
--conflict AUTO ... process files even if the destination file path already exists and replace the existing file (i.e. delete and overwrite) but only if the new file is better (i.e. higher resolution, higher bitrate, larger file size, etc) than the old file
Code: Select all
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict AUTO
[MOVE] from [Avatar.2009.mp4] to [Avatar (2009).mp4]
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict AUTO
Skipped [Avatar.2009.mp4] because [Avatar (2009).mp4] already exists
--conflict INDEX ... add .1 .2 .3 etc to the destination file path if necessary so that the given file can be processed
Code: Select all
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict INDEX
[MOVE] from [Avatar.2009.mp4] to [Avatar (2009).1.mp4]
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict INDEX
[MOVE] from [Avatar.2009.mp4] to [Avatar (2009).2.mp4]
--conflict FAIL ... fail and stop processing files once a file cannot be processed
Code: Select all
$ filebot -rename Avatar.2009.mp4 --db TheMovieDB --log INFO --conflict FAIL
Failed to process [Avatar.2009.mp4] because [Avatar (2009).mp4] already exists
Conflict Actions:
The --conflict parameter accepts custom Groovy code as parameter value. The code is expected to define a Function(File, File) that returns either null (e.g. skip behaviour) or a File object that either confirms (e.g. replace behaviour) or changes (e.g. index behaviour) the target path.
e.g. replace target file but only if the source file is larger:
Code: Select all
--action '{ from, to -> from.length() > to.length() ? to : null }'
Code: Select all
--conflict /path/to/VideoCodecOrder.groovy
Code: Select all
{ from, to ->
def score = { f ->
['HEVC':20, 'AVC':10][f.mediaCharacteristics.videoCodec] ?: 0
}
score(from) > score(to) ? to : null
}