Variables and how to use them
xstrex opened this issue · comments
I've already asked this question on Discord & Reddit, and no one seems to know. How are variables used in Tdarr?
On each library I set a variable called type:
to the content name of the library. After the media is processed, it (should) be sorted based on type:
then perform an additional action. But the type variable gets skipped every time, and I’ve got no idea why. Plus the documentation references an older, non-relevant use of variables that doesn’t match the UI.
How should I be using variables?
Unanswered post on discord (with pictures): https://discord.com/channels/623392507828371476/1227992929268928512
Hi, not sure what you have tried so far, so I'll try to be as thorough as I can in the hope than you can pick up the solution to your problem.
- Set the variable on every library that is gonna use the flow.
![image](https://private-user-images.githubusercontent.com/11569431/328951631-fbb08a9a-70a9-43a9-82be-4c7c71011a45.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTczMDE4OTksIm5iZiI6MTcxNzMwMTU5OSwicGF0aCI6Ii8xMTU2OTQzMS8zMjg5NTE2MzEtZmJiMDhhOWEtNzBhOS00M2E5LTgyYmUtNGM3YzcxMDExYTQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAyVDA0MTMxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMDRkYjZhZjQxZWFiODEwYTBlOWZhNjdiZmUzMDJiNWIyOTkzYzEwMjQ1NWQ0MTNjY2RkODU0MWUzMGVkMGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AH_Xw4RMHKoNsvk59DdsvNiRjr6OzFaHGooZW7qgTbo)
-
Use the "Check Flow Variable" from the list of Flow Plugins, using the help tooltip of each input to understand what's expected by the plugin.
-
Run a test and check the logs.
![image](https://private-user-images.githubusercontent.com/11569431/328950200-bc64127b-ee90-4e44-a8e9-32f2cf084e6e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTczMDE4OTksIm5iZiI6MTcxNzMwMTU5OSwicGF0aCI6Ii8xMTU2OTQzMS8zMjg5NTAyMDAtYmM2NDEyN2ItZWU5MC00ZTQ0LWE4ZTktMzJmMmNmMDg0ZTZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjAyVDA0MTMxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4ODJjMDk5MDIxNjE2ZDUxMDAxNDc5ODgyYjJiMmMxNGEyNWM0NDU5MGZhMGRmOGIyYWRiZWIzMTdmYzBmZGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YFEZiruJcreB0Pvee-AG65wSkZCrmGaWm2EcFauJtDg)
Ah! Thank you! I've been fighting with this for weeks!
I was missing the args.userVariables.library.
and was just checking library == movie
, not args.userVariables.library.library == movie
. Thanks so much!!
I know from experience that documentation is usually the last thing to be updated, but this section could use a little better explanation imo.
Happy to help ;)
I know from experience that documentation is usually the last thing to be updated, but this section could use a little better explanation imo.
Couldn't agree more. Especially since most of the time you need the brackets {{{}}} around the variable but in this specific case you don't :S It's confusing. But Flows are still kinda new.
@xstrex pleased you got it working. Not sure if you saw the examples by clicking the ? button on the input but worth starting there.
@Marnalas yes that plugin was done before the {{{}}} templating system was implemented. It was actually updated earlier today so using {{{}}} is the correct way (will show in the examples if you check the latest plugins) but still works without it so doesn’t break any existing setups.