Page 1 of 1
What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 21 Feb 2022, 05:33
by nanobot001
Am trying to make my way through the AMC
viewtopic.php?f=4&t=215
Have zero experience with this stuff.
Regarding this part
Code: Select all
--def unsorted=y music=y artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
Is there some kind of reference for what ut_label, ut_state, ut_title are all referring to?
I have kind of inferred what they all are from the examples, but have I missed a reference somewhere?
Thanks
Re: super dumb question
Posted: 21 Feb 2022, 06:08
by rednoah

Which tool are you using? The details differ depending on the tool you're using, but the gist is always to make it execute some arbitrary command-line tool, which happens to be
filebot for our purposes:
The
--def ut_* variables are meant to pass along information from the tool that is executing
filebot to the
filebot call itself:
rednoah wrote: ↑01 Aug 2012, 13:04
Troubleshooting
If something is not working, please
read the Notes above, then
run the command manually in a new console window to see what is happening.
You CANNOT run the command without replacing the VARIABLES. The variables have to be replaced with actual values first.
e.g.
Code: Select all
filebot ... --def "ut_dir=D:\Media\Avatar" "ut_file=" "ut_kind=multi" "ut_title=Avatar" "ut_label=" "ut_state=5"
The
%variables are specific to the tool that is executing
filebot, and different tools may do things in different ways
(e.g. replacement patterns, arguments, environment variables, etc) and in this case we assume that
%variables are going to be replace with some specific values that
filebot is then called with:

Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 21 Feb 2022, 16:38
by nanobot001
I think that makes a lot of sense.
It really helped just trying the CLI and working a few things out on my own
In my fiddling, I am noticing that for Anime the "episode order" is "absolute". How can I change this so it is "air date"
Thanks
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 21 Feb 2022, 16:53
by rednoah
nanobot001 wrote: ↑21 Feb 2022, 16:38
In my fiddling, I am noticing that for Anime the "episode order" is "absolute". How can I change this so it is "air date"
You could use
--def ut_label=TV to force TV Series mode for all files. This may or may not work well depending on how your files are named and numbered. But
[Anime] Convert Absolute to SxE numbers is a completely different topic entirely, and may range from easy to tricky to impossible, depending on the specific use case / series you're dealing with. Best to deal with that manually in the GUI as needed.
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 21 Feb 2022, 18:11
by nanobot001
changing the --def ut_label=TV worked, in that the order episode date was "airdate", but of course, it changed the output directory to include "TV Shows" and not "Anime".
Is there anyway to force the amc script to output in a way that a) uses the ut_label=TV and then b) forces the output so it does not go to "TV shows"
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 22 Feb 2022, 01:15
by rednoah
Yes, you can pass a custom
--def seriesFormat. Please read the
Change how files will be organized and renamed section for details.

You'll want to prototype your custom format in the Format Editor GUI:
https://www.filebot.net/naming.html
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 22 Oct 2023, 05:36
by cheaters
@rednoah
Hello
Does FileBot need/use/expect the strings as you have written them:
ut_label,
ut_title, etc. ? Can that nomenclature be changed or will it break FileBot's ability to understand shell scripts.
qBittorrent v4 has changed their parameter names and I see no correlation or complete list in this forum for matching "ut_*" parameters. I don't want to guess what to use for qBittorrent's Category, Tags, and other parameters that you don't appear to have strings for...

I.e. do we use "ut_cat=%L" and "ut_tag=%G"?
I also never understood what "ut_kind=multi" does or if it's required?

Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 23 Oct 2023, 03:02
by rednoah
The
%variables used in the examples are used, and all other variables are not used.
Automated Media Center › Troubleshooting has an example command-line call with all variables filled in.
"ut_kind=%K" is used for uT because uT has a
%K variable that can be either
single or
multi. qBT does not have a
%K variable
(EDIT: looks like it has a %K variable now but it's got a completely different meaning) so we pass in a fixed value instead. Different torrent clients work in different ways, but the goal is always a uniform
amc script call with the completed download information passed along via command-line arguments. Please compare & contrast
Automated Media Center › Setup Instructions for details.

The
qBT setup instructions in the manual apply to qBT 4 and not qBT 3 so you can just copy & paste from the instructions.
--def "ut_label=%L" "ut_title=%N" "ut_kind=multi" "ut_dir=%F" is indeed expected / required according to the qBT instructions.
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 06:24
by Wolfie
Would it be possible to add in tag support, where tags (comma separated) would be put into two arrays?
{tags[0]} returns returns the first tag, etc.
{tag['name']} returns true if the tag has been set (but false otherwise vs an error)
So if I use a tag like "TD," then {tag['TD']} will return true, but {tag['notTD']} will return false. Likewise, {tags[0]} would return "TD."
This would allow the use of expected tags (via "tag") and unexpected tags (via "tags") in scripts.
Either that, or is there a way that I can create/pass a variable from command line that could be used in my format script?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 06:58
by rednoah
{tags} is a
List so you can easily check if that
List contains a certain value in a variety of ways.
e.g. Operators › Find
e.g. Operators › Membership
e.g. List.contains(Object)

Note that
{tags} is unrelated to
qBT. Please read
The movie {tags} and movie {edition} bindings for details.

You can use
{label} and
{defines} to access
--def ut_label specifically or the all
--def name=value parameters.
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 07:16
by Wolfie
rednoah wrote: ↑01 Dec 2023, 06:58

You can use
{label} and
{defines} to access
--def ut_label specifically or the all
--def name=value parameters.
So something like
--def qtags="%1" would let me use
{qtags}?
Would it already be in an array, or would I need to split it? If so, would splits honor quote marks (if separating by commas)? And any way to have it create keys from the values?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 07:44
by rednoah
Wolfie wrote: ↑01 Dec 2023, 07:16
So something like
--def qtags="%1" would let me use
{qtags}?
No. The binding is
{defines} and it will give you a
Map of all the
--def name=value pairs:
e.g.
Console Output: Select all
$ filebot -mediainfo . --format "{defines} | {defines.x} | {fn}" --def x=1 y=2 z=3
{x=1, y=2, z=3} | 1 | doctor.who.2005.s01e01
Wolfie wrote: ↑01 Dec 2023, 07:16
Would it already be in an array, or would I need to split it? If so, would splits honor quote marks (if separating by commas)? And any way to have it create keys from the values?
Please post an example file path and desired output value so that we have something to talk about.
"quote mark" does not make sense in the context of using a
List object in Groovy code. The command-line interpreter takes care of splitting by space and honouring quote marks before
filebot is even called.
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 07:58
by Wolfie
Let's say that I have tags of TD,IPT, and "One Two," and all three are in a define.
--def qtags="%1" translates to --def qtags="TD,IPT,One Two"
How would I access it in the format file?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 01 Dec 2023, 08:07
by rednoah
defines.qtags will give you a single
String value, hence:
Console Output: Select all
$ filebot -mediainfo . \
--format "{defines} | {defines.qtags} | C1={ defines.qtags.contains('One') } | { defines.qtags.tokenize(',') } | C2={ defines.qtags.tokenize(',').contains('One') } | C3={ defines.qtags.tokenize(',').contains('One Two') } | {fn}" \
--def qtags="TD,IPT,One Two"
{qtags=TD,IPT,One Two} | TD,IPT,One Two | C1=true | [TD, IPT, One Two] | C2=false | C3=true | doctor.who.2005.s01e01
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 15 Jun 2024, 08:43
by Wolfie
Either I'm encountering a bug or I'm doing something wrong. I recall trying it when you initially showed it to me it worked. Now, when doing that same command, no matter what I try to use, it tells me that "
Code: Select all
This is not a -script call. The script parameter --def (name) has no effect.
"
Be it qtags, or even music. Calling on it from within a bat file, some tags are accepted (music, unsorted, ut_label, etc.), but custom tags are not. Any ideas?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 15 Jun 2024, 11:41
by rednoah
If you're manually passing in
--def name=value parameters so you can then use them in your custom format for simple
-rename calls, then the warning above is indeed a
false positive. If your code works for you, then ignore the warnings.

The
This is not a -script call. warning is meant for users that do simple
filebot -rename calls but then add random
amc script options expecting those options to do something. The simple
filebot -rename never use any
--def name=value options, except for the rare corner case
(you're probably the only one in the world) where your custom format code
(NOTE: filebot does not know what your format code does or does not do) actually does use them.

Note that this thread is about
amc script options, so if you get the
This is not a -script call. warning then you are notably
not using the
amc script script. What are you trying to do anyway? What's your command-line call?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 15 Jun 2024, 16:52
by Wolfie
When doing it in a script, I'm trying to pass "ttags" and get
Console Output: Select all
Invalid usage: --def ttags is not used and has no effect
as a result.
Using the command prompt directly, I get this:
Console Output: Select all
P:\FileBot>filebot -mediainfo --format "{defines} | {defines.qtags} | {fn}" --def "music=n" qtags="TD,IPT,One Two"
* This is not a -script call. The script parameter --def music has no effect.
* This is not a -script call. The script parameter --def qtags has no effect.
No input arguments
The script processes the "ut_label" and other suggested items (ut_title for example) just fine, but a custom one, no go.
ETA: Nevermind on the command line one, I realized that I forgot the "." for the file.

Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 15 Jun 2024, 18:54
by rednoah
Yep, in your specific case these warnings don't make sense, so you can ignore them. The warnings are there for users who accidentally make up their own parameters, mistype parameters, etc, and thus mistakenly end up with options that don't actually do anything.

Adding
--log FINEST to the command will make these "help" messages go away.
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 15 Jun 2024, 20:46
by Wolfie
So then in the script, "ttags=(whatever)" still works, just Fb is throwing the warning as a precaution?
Re: What does "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" mean?
Posted: 16 Jun 2024, 10:34
by rednoah
Pretty much. It usually indicates a user error. Except in your specific use case. FileBot itself indeed does not use your custom variables, though you might in your specific custom code.