HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
2.99k stars 92 forks source link

flow variables are broken in v2.27.02 #1107

Closed taltamir closed 2 hours ago

taltamir commented 2 hours ago

Describe the bug evaluate flow variable is broken in v2.27.02. the evaluator incorrectly uses their name and not value.

To Reproduce import the json testflow.json

this results in:

2024-10-27T10:27:26.236Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:variable = "cvideo"
2024-10-27T10:27:26.237Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:targetValue = cvideo
2024-10-27T10:27:26.242Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:Variable cvideo of value cvideo does not match condition == true
2024-10-27T10:27:26.242Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:Plugin run complete
2024-10-27T10:27:26.242Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:{"_id":"/mnt/t/arcserv/vids/.app/tdarr/test/test.mkv","outputNumber":2,"variables":{"user":{"cvideo":"true","caudio":"true"}}}
2024-10-27T10:27:26.242Z O7Gg57b5G:Node[t-desk]:Worker[neat-nag]:Found next plugin: pDMJZUJkT::uTH30CEpz incorrect result on flow variable

The error is in targetValue = cvideo. the actual target value is true as can be seen in the json and in screenshots

Expected behavior it should do targetValue = true not targetValue = cvideo

full log output output from worker.txt

Additional Screenshots testflow target-val

HaveAGitGat commented 2 hours ago

You have not used the correct syntax to check the variable. In the set flow variable plugin help pop up, check the syntax that should be used to access the variable.

HaveAGitGat commented 2 hours ago
Variable to set.

  Example
      transcodeStage

      You can then check this in the 'Check Flow Variable' plugin
      {{{args.variables.user.transcodeStage}}}

Check flow variable can be used to check hundreds of different fields on the args object so that’s the reason it’s like that.

https://github.com/HaveAGitGat/Tdarr_Plugins/blob/7b3f9ee4d0fc4c5ebe4f42aaa70a61b1b838df2a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts#L125

taltamir commented 2 hours ago

@HaveAGitGat Thank you. I apologize for my error.

But in that case there is an issue with the logfile wording. which is both misleading and inconsistent.

  1. when using the correct syntax, the evaluation line in the log refers to the value correctly, but incorrectly states that the variable is named the contents of its "value". (it does NOT do so in multiple other lines. only evaluator line gets it wrong).

    Variable true of value true matches condition == true

    should say instead

    Variable {{{args.variables.user.cvideo}}} of value true matches condition == true

    every other line in the log uses Variable for variable name and Value for value. But that one line where evaluation happens mixes them up. Which is misleading when trying to debug why things are not working.

  2. when trying to evaluate a wrongly named variable it does the opposite. (hence inconsistant) It refers to variable name correctly, but refers to value as the variable name:

    Variable cvideo of value cvideo does not match condition == true

    should instead say

    Variable cvideo of value "" does not match condition == true

    a nonexisting variable should have a value of "" not a value of its variable name.