[DOCS] How do I select only specific files from the input folder?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 24326
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[DOCS] How do I select only specific files from the input folder?

Post by rednoah »

GUI

Presets allow you to set a default input folder from which files are loaded. An additional file filter expression allows you to select only specific files from that default input folder.


e.g. select only video files:

Groovy: Select all

f.video
e.g. select only episode files:

Groovy: Select all

f.episode
e.g. select only movie files, i.e. files that are not episode files:

Groovy: Select all

none{ f.episode }
e.g. select files that are not *.jpg or *.png files and do not match *sample* or *trailer* in the file name and do not match *Extras* or *Featurettes* in the file path:

Groovy: Select all

none{ ext =~ /jpg|png/ }{ fn.match(/sample|trailer/) }{ folder.path.match(/Extras|Featurettes/) }
e.g. select files that have not yet been processed, i.e. files that do not have xattr metadata and are not recorded in the local history yet:

Groovy: Select all

none{ historic.f || f.metadata }




CLI

The --file-filter option can be used to pass a file filter expression on the command-line:

e.g. select only video files:

Shell: Select all

filebot -rename -r "/path/to/files" --file-filter "f.video"
e.g. select only episode files:

Shell: Select all

filebot -rename -r . --file-filter "f.episode" --db TheMovieDB::TV
e.g. select only movie files:

Shell: Select all

filebot -rename -r . --file-filter "none{ f.episode }" --db TheMovieDB
e.g. select only files that have not already been hardlinked:

Shell: Select all

filebot -rename -r /input --file-filter "f.linkCount == 1" --action hardlink --db xattr --output /output --format "{plex.id}"
:arrow: Please read How do I process specific files with specific command-line options? for details and examples.
:idea: Please read the FAQ and How to Request Help.
Post Reply