Organize Anime into Complete/Ongoing folders with ANIDB

Any questions? Need some help?
Post Reply
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

Is it possible to organize anime series into complete/ongoing folders with anidb? Sadly, they do not use a simple tag like tvdb does for a series being complete or not.. Although they do have an airing date.

I spent about an hour messing around and although I got close with this:

Code: Select all

{model.episode.containsAll(episodelist) ? 'Complete' : 'Ongoing'}
It incorporated specials, which isn't really what I wanted :/
Last edited by dragonandlance on 28 Apr 2018, 00:50, edited 1 time in total.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by kim »

maybe you can use

Code: Select all

{model.episode.seriesInfo.status}
or

Code: Select all

{info.status}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by rednoah »

You can filter out all the specials. The {age} binding (i.e. days since aired) might also be useful because if all episodes have an {age} then it's complete, but if it's ongoing then {age} will fail for episodes in the future.

It's a bit tricky. There's many possible solutions, but I can't tell you which logic might work best here.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by kim »

looks like it gives only "null" ?

so maybe rednoah can add
enddate
https://wiki.anidb.net/w/HTTP_API_Definition
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

It would be cool if enddate was added, as there already is a startdate, right?

Otherwise, how would I filter out specials? I can't seem to get it to work in cmdline with filter.

I essentially want episodelist to ignore specials, so that even if a series is missing them, it will still be put in the complete folder, as long as I have all of the regular episodes.

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

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by rednoah »

Find all non-special episodes:

Code: Select all

episodelist.findAll{ !it.special }
You can combine that with model.episode to check if the current match model contains all regular episodes:

Code: Select all

episodelist.findAll{ !it.special } in model.episode
:idea: Please read the FAQ and How to Request Help.
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

Thanks so much!

I got it working with this:

Code: Select all

{if (episodelist.findAll{!it.special} == model.episode) 'Complete'}{if (episodelist.findAll{!it.special} != model.episode) 'Ongoing'}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by rednoah »

This is easier to read:

Code: Select all

episodelist.findAll{!it.special} == model.episode ? 'Complete' : 'Ongoing'
:idea: Please read the FAQ and How to Request Help.
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

That is better!

Hmm I can't seem to get "<" or ">" to work in this instance?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by rednoah »

What would you like to compare? You can compare numbers. You can't compare sets. You can compare the size of a set though.
:idea: Please read the FAQ and How to Request Help.
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

I wanted to compare model.episode to episodelist; so that if there's more or equal episodes to the episode list, its complete, and if there's less, its ongoing.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by rednoah »

e.g.

Code: Select all

episodelist.count{!it.special} < model.size()
:idea: Please read the FAQ and How to Request Help.
dragonandlance
Posts: 15
Joined: 17 Sep 2017, 22:28

Re: Organize Anime into Complete/Ongoing folders with ANIDB

Post by dragonandlance »

It's kinda funny I tried both count and size, I just didn't do it right!

Thanks so much!
Post Reply