Page 1 of 1
Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 26 Apr 2018, 08:33
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 :/
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 26 Apr 2018, 16:44
by kim
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 26 Apr 2018, 17:25
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.
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 26 Apr 2018, 17:26
by kim
looks like it gives only "null" ?
so maybe rednoah can add
enddate
https://wiki.anidb.net/w/HTTP_API_Definition
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 26 Apr 2018, 20:28
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!
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 27 Apr 2018, 18:13
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
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 00:49
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'}
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 02:09
by rednoah
This is easier to read:
Code: Select all
episodelist.findAll{!it.special} == model.episode ? 'Complete' : 'Ongoing'
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 02:39
by dragonandlance
That is better!
Hmm I can't seem to get "<" or ">" to work in this instance?
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 03:06
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.
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 03:12
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.
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 03:19
by rednoah
e.g.
Code: Select all
episodelist.count{!it.special} < model.size()
Re: Organize Anime into Complete/Ongoing folders with ANIDB
Posted: 28 Apr 2018, 03:50
by dragonandlance
It's kinda funny I tried both count and size, I just didn't do it right!
Thanks so much!