🧮 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.
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.
Here is the complete list of available library variables.
Variable | Key Example | Used By Flow | Arg | Note |
---|---|---|---|---|
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 |
enable_initialization | true | Controller & Initialization | {{{args.userVariables.library.enable_initialization}}} |
Coming Soon lowercase, true/false |
enable_subs_cleaning | true | Controller & Subs Cleaning | {{{args.userVariables.library.enable_subs_cleaning}}} |
lowercase, true/false |
enable_audio_cleaning | true | Controller & Audio Cleaning | {{{args.userVariables.library.enable_audio_cleaning}}} |
lowercase, true/false |
enable_audio_transcoding | true | Controller & Audio Transcoding | {{{args.userVariables.library.enable_audio_transcoding}}} |
lowercase, true/false |
enable_video_transcoding | true | Controller & Video Transcoding | {{{args.userVariables.library.enable_video_transcoding}}} |
lowercase, true/false |
enable_notifications | true | Controller & Notification | {{{args.userVariables.library.enable_notifications}}} |
lowercase, true/false |
enable_cleanup | true | Controller & Cleanup | {{{args.userVariables.library.enable_cleanup}}} |
lowercase, true/false |
quality_level | 21 | Video Transcoding | {{{args.userVariables.library.quality_level}}} |
18 to 25 recommended. lower = higher quality. Only used for CPU encoding |
is_animated | true | Video Transcoding | {{{args.userVariables.library.is_animated}}} |
Only used for cpu transcoding. Defaults to false. |
use_nvenc | false | Video Transcoding | {{{args.userVariables.library.use_nvenc}}} |
lowercase, true/false |
ffmpeg_preset | slower | Video Transcoding | {{{args.userVariables.library.ffmpeg_preset}}} |
lowercase. Options: slower, slow, medium, fast, faster. NVENC cannot use 'slower' |
nvenc_preset | 7 | Video Transcoding | {{{args.userVariables.library.ffmpeg_preset}}} |
Coming Soon FFMPEG 7 changed how nvenc uses presets. Options: 1 through 7, 7 being the highest quality |
use_checkpoints | false | Controller | {{{args.userVariables.library.useCheckpoints}}} |
Optional. Should we overrwrite the source file after each flow? |
check_hardlinks | true | Controller | {{{args.userVariables.library.check_hardlinks}}} |
Optional. Filter check to see if video is hard linked anywhere. |
keep_8ch_audio | true | Audio Transcoding | {{{args.userVariables.library.keep_8ch_audio}}} |
Coming Soon Optional. Defaults to false |
remove_commentary | true | Audio Transcoding | {{{args.userVariables.library.remove_commentary}}} |
Coming Soon Optional. Defaults to false |
use_unraid | true | Cleanup | {{{args.userVariables.library.enable_unraid}}} |
Coming Soon Sets file permissions for unraid setups. Defaults to false |
is_foreign | false | Audio Transcoding | {{{args.userVariables.library.enable_unraid}}} |
Optional. Defaults to false. Used for putting foreign audio in front of English should sonarr/radarr connections fail |
Minimum Required Library Variables
[UNFINSIHED] 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.
Variable | Key Example | Used By Flow | Arg | Note |
---|---|---|---|---|
name | MOVIES | All | {{{args.userVariables.library.name}}} |
Must be all uppercase |
General Rules of Thumb
- booleans are always lowercase
- labels, i.e 'name' are always uppercase