How to get the number of episodes for a series?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

How to get the number of episodes for a series?

Post by rv23 »

Is there a way to get the # of episodes for a specific Series in TheTVDB and AniDB other then getEpisodeList?

So far it seems like I'd have to get the episode list (AniDB.getEpisodeList and TheTVDB.getEpisodeList) and count the # of episodes returned..

Is this effectively the "best" method? or is there another option that I am overlooking?

Thanks
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: How to get the number of episodes for a series?

Post by kim »

Code: Select all

{episodelist.size()}
-specials

Code: Select all

{episodelist.findAll{it.episode}.size()}
specials

Code: Select all

{episodelist.findAll{it.special}.size()}
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Re: How to get the number of episodes for a series?

Post by rv23 »

Thanks Kim

I'll look into these, are these bindings available only format/filter etc? would they be available in groovy script directly or would I need to call some method to get them?

I should have mentioned I was trying to get this information within a groovy script, prior to calling rename.

I'm exploring options on renaming Anime that works when in strict mode, with some stupidly named files that make it hard to programmatically match them reliably.

aka
(CBB) Sword Art Online - Alicization - War Of Underworld - 22 (1080p)(HEVC)(10bit-x265-AAC).mkv

The Anime Series would Match Sword Art Online for TVDB, and Sword Art Online - Alicization - War Of Underworld for AniDB.
However this is actually Sword Art Online - Alicization - War Of Underworld (2020) on AniDB, Episode #11 or Sword Art Online Season 4 Episode 22.

A default strict rename will totally fail on AniDB (Since Sword Art Online - Alicization - War Of Underworld only has 11 episodes, it can't match episode 22) and the TVDB matches it to Sword Art Online Episode 22, now using Animelist.AniDB, does work..

But I want to be able to programmatically figure out when to use the mapper when matching with TheTVDB ...

hmm..

It just occurred to me, that perhaps there is no real harm in always using AnimeList.AniDB mapper when renaming against TVDB... that's a thought, I'll have to test that out.

If you are curious on why .. I download alot of fansub anime and want to parse it as accurately as possible after downloaded, and then using Filebot/AniDB/Shoko reduce the extra's to just the fansub groups with the "best" subs/picture combo.

Filebot is fairly good at getting "it right" in general, but Anime seems to me to be a giant PITA, and opportunistic matching just produces too many false matches for my liking, and the default amc strict too few matches.. So scripting time :)

Thanks for the help
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to get the number of episodes for a series?

Post by rednoah »

If you kinda know what might work, then you can try selecting all and have FileBot maybe figure it out, i.e. have FileBot consider additional options in addition to the default ones:
rednoah wrote: 12 Aug 2019, 13:11 Map to multiple episodes at the same time, in the hope that one of these additional options matches your files, and let the matcher figure out the rest:
(e.g. useful if you don't know what you're dealing with in advance and want FileBot to consider multiple possibilities)

Code: Select all

[episode, AnimeList.AniDB]
:!: Might introduce additional ambiguity that may break some use cases while making others work

:!: Might not work with strict mode (if the numbers don't match, then strict mode won't like that, but that's the same regardless of whether you have a 1:1 mapper or a 1:N mapper)
:idea: Please read the FAQ and How to Request Help.
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Re: How to get the number of episodes for a series?

Post by rv23 »

Thanks!,

I revisited the page on using --mapper and noticed that you can use 1:N mappers and have been experimenting with it.

At this time I'm good with the responses here and will digest what I have learned.

Thanks again.
Post Reply