Pad episode number to 3 digits when at or over 100 episodes in a season
Posted: 17 Aug 2023, 19:26
I am looking to make it that when I have a show that has over 100 episodes in a season that the entire season has 3 digits for the episode number. This ensures that no matter the sort method of filesystems or applications, the episodes will show up in order.
I know I can manually do this replacing
with something like
However, I was hoping to do a "set it and forget it" type of thing, so I tried researching and came up with
But I get an "Unexpected input" error with the letter "E" for the pad (no clue why since it works without the if/then/else portion when I simply replace the {S00E00} portion -- I tried it with and without quotes) and if I remove the letters (for testing), I get the following error:
I'm not very knowledgeable with groovy scripting, but have learned enough to believe this is possible... I'm just not seeing it. Any suggestions?
I know I can manually do this replacing
Groovy: Select all
{S00E00}
Groovy: Select all
S{s.pad(2)}E{e.pad(3)}
Groovy: Select all
{{episodelist.count{ it.episode && it.season == s }} >= 100 ? S{s.pad(2)}E{e.pad(3)} : {S00E00}}
Console Output: Select all
Expression yields empty value: No signature of method: net.filebot.GroovyEngine.S() is applicable for argument types: (__script_819cc574498608c7564eef8ee3b38da7_2a$_run_closure1, __script_819cc574498608c7564eef8ee3b38da7_2a$_run_closure2) values: [__script_819cc574498608c7564eef8ee3b38da7_2a$_run_closure1@571c6ed3, ...]
Possible solutions: any(), is(java.lang.Object), wait(), dump(), find(), grep()