Comparison between series total episodes and season episodes
Posted: 24 Sep 2023, 22:41
Hello,
I kindly request your support for the following situation I'm facing with FileBot.
Goal: To write the absolute number in an anime series only when required.
Scenario:
I have the total amount of episodes for the series with: {episodelist.size()}
I have the total amount of episodes for the actual season with: {episodelist.findAll{ s == it.s }.e.max()}
Expectation: Compare above data, if the count of episodes it's the same for both, then, absolute numbers are not required, otherwise, I will write absolute numbers.
Problem:
The following sentence is always true, despite the series, I changed the comparison from "!=" to ">" and then I receive an error.
I believe that the root cause is that one (or both?) values are not integer, therefore, they can not be compared, but I was not able to force them as integer to be able to perform such comparison.
Can you please support me?
Error:
I kindly request your support for the following situation I'm facing with FileBot.
Goal: To write the absolute number in an anime series only when required.
Scenario:
I have the total amount of episodes for the series with: {episodelist.size()}
I have the total amount of episodes for the actual season with: {episodelist.findAll{ s == it.s }.e.max()}
Expectation: Compare above data, if the count of episodes it's the same for both, then, absolute numbers are not required, otherwise, I will write absolute numbers.
Problem:
The following sentence is always true, despite the series, I changed the comparison from "!=" to ">" and then I receive an error.
I believe that the root cause is that one (or both?) values are not integer, therefore, they can not be compared, but I was not able to force them as integer to be able to perform such comparison.
Can you please support me?
Groovy: Select all
{{episodelist.size()} != {episodelist.findAll{ s == it.s }.e.max()} ? {absolute} : null}
Code: Select all
"Expression yields empty value: Cannot compare __script_411ad9ab5f5328afaefd0ef0b7d3ccfb_85$_run_closure1 with value '__script_411ad9ab5f5328afaefd0ef0b7d3ccfb_85$_run_closure1@310986dc' and __script_411ad9ab5f5328afaefd0ef0b7d3ccfb_85$_run_closure2 with value '__script_411ad9ab5f5328afaefd0ef0b7d3ccfb_85$_run_closure2@5898f42e'"