🧮 Variables - jordanlambrecht/modular-tdarr-flows GitHub Wiki

Introduction

At the core functionality of our modular system are variables. They drive all aspects of our flows and keep you from having to need to hunt down and tinker with 100s of plugin settings. It allows for a "set it and forget it" approach that requires little to no human intervention.

Global Variables

I use global variables as a defacto dotenv and store any sensitive or easily forgettable info here.

I have a few groupings: Plex library IDs, my Plex token, volume mapping paths, Arr URLs, and Arr Tokens. The Tdarr paths vs plex paths are because Tdarr uses bind mounts via docker and Plex uses system paths.

Global Variables are set at Tools > Global Variables and are called using {{{args.userVariables.global.test}}}

If you plan on using any plex functionality on the notifications flow, you can find instructions on how to get your Plex library IDs here.

If you choose not to use any of these library values in your setup, make sure to go to the appropriate flow and disable the plugins that use it. For example, if you don't have a sonarr instance for anime, disable the plugins that reference it. None of these are required.

Variable Key Example Category Arg
plex_path_movies /Volumes/Drive_01/data/media/movies/ Plex Path {{{args.userVariables.global.plex_path_movies}}}
plex_path_tv /Volumes/Drive_02/data/media/tv/ Plex Path {{{args.userVariables.global.plex_path_tv}}}
plex_path_anime /Volumes/Drive_03/data/media/anime/ Plex Path {{{args.userVariables.global.plex_path_anime}}}
plex_libraryKey_movies 1 Plex Library Key {{{args.userVariables.global.plex_libraryKey_movies}}}
plex_libraryKey_tv 2 Plex Library Key {{{args.userVariables.global.plex_libraryKey_tv}}}
plex_libraryKey_anime 3 Plex Library Key {{{args.userVariables.global.plex_libraryKey_anime}}}
tdarr_path_movies /mnt/01/media/movies/ TDARR Volume Mapping {{{args.userVariables.global.tdarr_path_movies}}}
tdarr_path_tv /mnt/02/media/movies/ TDARR Volume Mapping {{{args.userVariables.global.tdarr_path_tv}}}
tdarr_path_anime /mnt/03/media/movies/ TDARR Volume Mapping {{{args.userVariables.global.tdarr_path_anime}}}
plex_token xxxxxxxxxxxxx Plex Token {{{args.userVariables.global.plex_token}}}
url_plex 192.168.1.xx Plex IP {{{args.userVariables.global.url_radarr}}}
url_radarr 192.168.1.xx:8989 Arr URL. Do NOT include http:// {{{args.userVariables.global.url_radarr}}}
url_sonarr 192.168.1.xx:8989 Arr URL. Do NOT include http:// {{{args.userVariables.global.url_sonarr}}}
url_sonarrAnime 192.168.1.xx:8989 Arr URL. Do NOT include http:// {{{args.userVariables.global.url_sonarrAnime}}}
api_key_radarr xxxxxxxxxxxxx API Key {{{args.userVariables.global.api_key_radarr}}}
api_key_sonarr xxxxxxxxxxxxx API Key {{{args.userVariables.global.api_key_sonarr}}}
api_key_sonarrAnime xxxxxxxxxxxxx API Key {{{args.userVariables.global.api_key_sonarrAnime}}}
api_key_tmdb xxxxxxxxxxxxx API Key {{{args.userVariables.global.api_key_tmdb}}}

Library Variables

Library Variables are unique to each library you create. They are set under the Variables tab of a library and can be called using {{{args.userVariables.library.test}}}.

You do not need to add optional library variables. They will default to false. That way, you can pick and choose which extra features you want to enable without worrying about cluttering up your variables tab. This system is designed with the core concept of customization and easy of use. As such, a lot of the Library Variables do not need to be added to each library.

Here is the complete list of available library variables.

Variable Key Example Used By Flow Arg Note Required? Default
name MOVIES All {{{args.userVariables.library.name}}} Must be all uppercase. Options: MOVIES, TV, ANIME, SPORTS, MASTERCLASS
enable_control_flow true All {{{args.userVariables.library.enable_control_flow}}} Prevents returning to the controller false
enable_initialization true Controller & Initialization {{{args.userVariables.library.enable_initialization}}} lowercase, true/false false
enable_subs_cleaning true Controller & Subs Cleaning {{{args.userVariables.library.enable_subs_cleaning}}} lowercase, true/false false
enable_audio_cleaning true Controller & Audio Cleaning {{{args.userVariables.library.enable_audio_cleaning}}} lowercase, true/false false
enable_audio_transcoding true Controller & Audio Transcoding {{{args.userVariables.library.enable_audio_transcoding}}} lowercase, true/false false
enable_video_transcoding true Controller & Video Transcoding {{{args.userVariables.library.enable_video_transcoding}}} lowercase, true/false false
enable_notifications true Controller & Notification {{{args.userVariables.library.enable_notifications}}} lowercase, true/false false
enable_cleanup true Controller & Cleanup {{{args.userVariables.library.enable_cleanup}}} lowercase, true/false false
use_nvenc false Video Transcoding {{{args.userVariables.library.use_nvenc}}} lowercase, true/false false
quality_level 21 Video Transcoding {{{args.userVariables.library.quality_level}}} 18 to 25 recommended. lower = higher quality. Only used for CPU encoding ✅ (if use_nvenc=false) 23
ffmpeg_preset slower Video Transcoding {{{args.userVariables.library.ffmpeg_preset}}} lowercase. Options: slower, slow, medium, fast, faster. NVENC cannot use 'slower' ✅ (if use_nvenc=false) slower
nvenc_preset 7 Video Transcoding {{{args.userVariables.library.ffmpeg_preset}}} FFMPEG 7 changed how nvenc uses presets. Options: 1 through 7, 7 being the highest quality. 7
use_checkpoints false Controller {{{args.userVariables.library.useCheckpoints}}} Should we overrwrite the source file after each flow? ⚠️ USE WITH CAUTION false
check_hardlinks true Controller {{{args.userVariables.library.check_hardlinks}}} Filter check to see if video is hard linked anywhere. false
keep_8ch_audio true Audio Transcoding {{{args.userVariables.library.keep_8ch_audio}}} Do you want 7.2 audio left intact? false
remove_commentary true Audio Transcoding {{{args.userVariables.library.remove_commentary}}} Do you hate commentary tracks? false
enable_unraid true Cleanup {{{args.userVariables.library.enable_unraid}}} Sets file permissions for unraid setups. Most users can leae this false. false
is_animated true Video Transcoding {{{args.userVariables.library.is_animated}}} Only used for cpu transcoding. false
is_foreign false Audio Transcoding & Subtitle Cleaning {{{args.userVariables.library.enable_unraid}}} Used for prioritizing foreign audio over English should sonarr/radarr connections fail. note: previously use_foreign false
flowErrorThreshold 4 Initialization {{{args.userVariables.library.flowErrorThreshold}}} How many times can the Initialization flow fail before moving on? 5
pluginErrorThreshold 3 Initialization {{{args.userVariables.library.pluginErrorThreshold}}} How many times can a plugin in Initialization flow fail before skipping that plugin? 2
use_minimum_filesize_boundary true Video Transcoding {{{args.userVariables.library.use_minimum_filesize_boundary}}} If a file is under a pre-determined size, do not run video transcoding. false
set_minimum_filesize_boundary 2.5GB Video Transcoding {{{args.userVariables.library.set_minimum_filesize_boundary}}} If using use_minimum_filesize_boundary, set the min size in GB, KB, or MB. 4.5GB for MOVIES, 1.5GB for ANIME, 2.5GB for TV
filesize_holdForReview true Video Transcoding {{{args.userVariables.library.filesize_holdForReview}}} If a video is flagged as too small, should we hold for review or automatically not transcode it? true

General Rules of Thumb

  • booleans are always lowercase
  • labels, i.e 'name' are always uppercase