Use {episodelist} binding to count episodes per season and check if a season is complete via the {model} binding

Support for Windows users
Post Reply
jerome
Posts: 31
Joined: 25 Feb 2019, 02:21

Use {episodelist} binding to count episodes per season and check if a season is complete via the {model} binding

Post by jerome »

Recently updated to

Code: Select all

FileBot 5.1.0 (r9972)
JNA Native: 6.1.4
MediaInfo: 23.07
7-Zip-JBinding: 16.02
Tools: fpcalc/1.5.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-09-01 (r931)
Groovy: 4.0.14
JRE: OpenJDK Runtime Environment 17.0.8
JVM: OpenJDK 64-Bit Server VM
System Property: net.filebot.theme=Metal
CPU/MEM: 12 Core / 4.8 GB Max Memory / 1.3 GB Used Memory
OS: Windows 10 (amd64)
STORAGE: NTFS [(C:)] @ 129 GB
DATA: C:\Users\User\AppData\Roaming\FileBot
Package: MSI
License: FileBot License PXXXXXXXXXX (Valid-Until: 2024-02-05)
I know that episode was impacted in this update but not sure how that impacts the code I use for episode count.

The following whether true or false evaluates to 00 in every instance now using either TVDB or TMDB:TV.

Code: Select all

{model.episode.containsAll(episodelist.findAll{it.season == s}) ? [episodelist.count{it.episode && it.season == s}.pad(2)] : [episodelist.count{it.episode && it.season == s}.pad(2)+'i']}
Any help on how to fix would be apreciated.

Thanks
J
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode Count

Post by rednoah »

The changes is primarily that {episodelist} now works exactly the same as {model}.


e.g. Number of episodes for the season at hand:

Format: Select all

{
	' [' + episodelist.count{ it.e && it.s == s }.pad(2) + ' episodes]'
}
e.g. Check if all episodes from the season at hand are currently loaded into FileBot:

Format: Select all

{
	model.episode.containsAll(episodelist.findAll{ it.e && it.s == s }.episode) ? ' [complete]' : ' [incomplete]'
}
:idea: Please read the FAQ and How to Request Help.
SnakeBonD
Posts: 9
Joined: 23 Jan 2022, 15:09

Re: Use {episodelist} binding to count episodes per season and check if a season is complete via the {model} binding

Post by SnakeBonD »

It works well with normal episodes, but when there are double episodes it returns me an incomplete season because the number of files is not good.
Image
Is there a solution for this?
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Use {episodelist} binding to count episodes per season and check if a season is complete via the {model} binding

Post by rednoah »

Try this:

Format: Select all

{
	model.episodes.flatten().containsAll(episodelist.findAll{ it.e && it.s == s }.episode) ? ' [complete]' : ' [incomplete]'
}
:idea: Please read the FAQ and How to Request Help.
Post Reply