Skip to content

Settings

Jessy Williams edited this page Jul 7, 2020 · 8 revisions

Preferences

Preferences can either by entered as command line arguments or from a config file.

Preference Arguments Description
-b, --batch batch mode; disable interactive prompts
-l, --lower rename files using lowercase characters only
-r, --recurse search for files in nested directories
-s, --scene scene mode; replace non ascii-alphanumerics with .
-v, --verbose increase output verbosity
--hits number limit the maximum number of hits for each query
--ignore pattern ignore files including these words (regex)
--language language language used for templating
--mask extension(s) only process files with given extensions
--no-cache disable and clear result cache
--no-guess disable best guess fallback; e.g. when no matches, network down
--no-overwrite prevent relocation if it would overwrite a file
--no-style disable colours and uses ASCII characters for prompts
--movie-api tmdb or omdb set movie api provider
--movie-directory path set movie relocation directory
--movie-format format set movie renaming format
--episode-api tvmaze or tvdb set episode api provider
--episode-directory path set episode relocation directory
--episode-format format set episode renaming format

Note: See Internationalization for additional details about the --language flag.

Directives

Whereas preferences configure how mnamer works, directives are one-off parameters that are used to perform secondary tasks like exporting the current option set to a file.

Directive Arguments Description
-V, --version display the running mnamer version number
--config-dump prints config JSON to stdout then exits
--config-ignore skips loading config file for session
--id-imdb id specify an IMDb movie id override
--id-tmdb id specify a TMDb movie id override
--id-tvdb id specify a TVDb series id override
--id-tvmaze id specify a TvMaze series id override
--media movie or episode override media detection
--test mocks the renaming and moving of files

Passing IDs

When using --id to specify a movie or series id you can can use the following sources for each provider:

Provider Accepted IDs
OMDb IMDb
TMDb TMDb, IMDb
TVDb TVDb, IMDb
TVMaze TVMaze, TVDb

Config Files

mnamer attempts to load preferences from a .mnamer-v2.json file in the home directory, the current working directory, and then in each directory up the drive towards the drive root. Config keys are the same as their command line arguments listed above except that dashes are replaced with underscores.

Config Only Settings

A couple of settings can only be set using a configuration file.

Key Type Description
api_key_omdb STRING OMDb API Key
api_key_tmdb STRING TMDb API Key
api_key_tvdb STRING TVDb API Key
api_key_tvmaze STRING TVMaze API Key
replace_before DICT[STRING: STRING] Replacements applied before matching
replace_after DICT[STRING: STRING] Replacements applied after matching

Creating a Config File

The --config-dump directive writes the current program preferences to stdout as json.

It can be used along with other arguments and will include preferences from any other loaded configuration files. If you want to ignore any loaded configuration files, e.g. to get the default configuration, you can use --config-ignore along with --config-dump.

There are many ways to capture this and save it as a file, e.g. using pipes to stream the output to a file in MacOS, Linux, and Unix systems:

mnamer --config-dump > .mnamer-v2.json.tmp && \
mv .mnamer-v2.json.tmp .mnamer-v2.json

Note: Take care not to write to a location that mnamer reads from because the stream will be created and opened for writing beforehand, resulting in an error. Either output to a temporary file before renaming to .mnamer-v2.json as in the example above, or use a tool like moreutils' sponge.

Clone this wiki locally