Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Regression from Jikan 4.2.2 - seasons endpoint returning too much unrelated anime #521

Open
1 task done
AniLeo opened this issue Mar 13, 2024 · 8 comments · May be fixed by #527
Open
1 task done

🐛 Regression from Jikan 4.2.2 - seasons endpoint returning too much unrelated anime #521

AniLeo opened this issue Mar 13, 2024 · 8 comments · May be fixed by #527
Assignees

Comments

@AniLeo
Copy link

AniLeo commented Mar 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Seasons endpoint for 2024 winter returns 516 anime, with a lot of unrelated anime such as
"One Piece" being included in the season
https://api.jikan.moe/v4/seasons/2024/winter?page=1

Expected Behavior

According to MAL, there are 203 entries in the same season
https://myanimelist.net/anime/season/2024/winter

Steps To Reproduce

Access https://api.jikan.moe/v4/seasons/2024/winter?page=1
See pagination -> items -> total at 516

Environment

Used public API

Anything else?

I suspect this is a regression from #513

@pushrbx
Copy link
Collaborator

pushrbx commented Mar 14, 2024

In this case somebody has to spell it out for me what needs to happen. You can't just say it has to match MAL, as I have no idea what MAL is doing. 😿

@irfan-dahir
Copy link
Contributor

irfan-dahir commented Mar 14, 2024

@AniLeo
Anime like One Piece and even Frieren are part of the winter 2024 season as they fall under "TV (Continuing)"
image

Also, MAL has a lot of other types of anime:
image
that they're not showing on the seasons screen it seems
image

For example, we also return the following type of entries:
https://api.jikan.moe/v4/seasons/2024/winter?page=1&filter=music (43 entries)
https://api.jikan.moe/v4/seasons/2024/winter?page=1&filter=PV (14 entries)
https://api.jikan.moe/v4/seasons/2024/winter?page=1&filter=CM (17 entries)
https://api.jikan.moe/v4/seasons/2024/winter?page=1&filter=tv_special (23 entries)

Etc. That's already 97 entries in addition. And if we check the responses, most of the entries are continuing from past years and are still in "Airing". Their status are 1:1 with what MAL is showing for those entries as well.


But https://api.jikan.moe/v4/seasons/2024/winter?page=1 showing continuing anime also up front; while that logically makes sense as MAL is also returning the entries sorted by their members it might not make sense with it showing up front all the time for every season. MAL has also segregated into their own categories on the UI.

@pushrbx
So perhaps the fix here could be to just not return continuing anime by default (as this affects not just TV types but all types of entries) and have a flag for it (e.g ?continuing).

Our number of entries would always still be higher than what MAL returns because we're providing complete data which is fine IMO but at least we'd have more accurate data displayed up front by default. What do you guys think?

@AniLeo
Copy link
Author

AniLeo commented Mar 15, 2024

@irfan-dahir You're right, my bad for missing the continuing ones; MAL also has them and they're part of the "Entries" count at the top of the page, so even if we have 97 entries of types that are not accounted for we're still at around 310 anime as opposed to the 516 entries returned by the endpoint

image

I looked into some entries and noticed that anime that has airing date finishing this season is displayed on subsequent seasons as if it was continuing there

For example:
https://myanimelist.net/anime/54492/Kusuriya_no_Hitorigoto

It's displayed on every season of the year
https://api.jikan.moe/v4/seasons/2024/winter?page=1
https://api.jikan.moe/v4/seasons/2024/spring?page=1
https://api.jikan.moe/v4/seasons/2024/summer?page=1
https://api.jikan.moe/v4/seasons/2024/fall?page=1

And it has an end of airing date Aired: Oct 22, 2023 to Mar 24, 2024

If you check the next season (Spring 2024), the only anime that is listed in TV (Continuing) is https://myanimelist.net/anime/57218/Geomeongsupeul_Jikyeola_Birdy_Friends which has an end date of May 16, 2024

Following this behaviour, it seems that airing anime that has unknown end date should only be included on the current season, not on future ones


While I was checking this, something else that I noticed that's weird and might need to be split into its own separate ticket, is that the API reports an inconsistent amount of items depending on the page you're on

page 1 reports pagination->items->total as 516, but every subsequent page reports a total of 479
https://api.jikan.moe/v4/seasons/2024/winter?page=1
https://api.jikan.moe/v4/seasons/2024/winter?page=2
page 1 also reports last page as 21 while subsequent pages report last page as 20

@Jetskiis
Copy link

Jetskiis commented Mar 16, 2024

Following this issue.

Many shows such as https://myanimelist.net/anime/51180/Youkoso_Jitsuryoku_Shijou_Shugi_no_Kyoushitsu_e_3rd_Season (airing only this season) appear in API calls to future seasons like https://api.jikan.moe/v4/seasons/2024/spring?page=1&filter=tv

@pushrbx
Copy link
Collaborator

pushrbx commented Mar 16, 2024

Found the bit of code which is responsible for the inclusion of "Youkoso_Jitsuryoku_Shijou_Shugi_no_Kyoushitsu_e_3rd_Season" in the spring season:

// this condition will include "continuing" items from previous seasons
[
'aired.from' => ['$lte' => $from->toAtomString()],
'airing' => true
]

@pushrbx
Copy link
Collaborator

pushrbx commented Mar 16, 2024

@AniLeo

While I was checking this, something else that I noticed that's weird and might need to be split into its own separate ticket, is that the API reports an inconsistent amount of items depending on the page you're on

page 1 reports pagination->items->total as 516, but every subsequent page reports a total of 479
https://api.jikan.moe/v4/seasons/2024/winter?page=1
https://api.jikan.moe/v4/seasons/2024/winter?page=2
page 1 also reports last page as 21 while subsequent pages report last page as 20

This happens time to time because of some long existing cache issue.

Also are you ok with irfan's proposed fix?

So perhaps the fix here could be to just not return continuing anime by default (as this affects not just TV types but all types of entries) and have a flag for it (e.g ?continuing).

@AniLeo
Copy link
Author

AniLeo commented Mar 16, 2024

@pushrbx yes, for me the addition of the flag, as well as fixing the airing bug that you pointed out in the code is good to solve this ticket

If we have other specific cases that don't match what's in MAL I will get back to you in the future with specific details for these cases

Thank you!

@Jetskiis
Copy link

Yes, having a continuing flag would be great and so that way the API would return long running seasonal's such as One Piece

pushrbx added a commit that referenced this issue Apr 9, 2024
- added a new parameter: "continuing"
- continuing items from previous seasons are now excluded by default
- should fix #521
@pushrbx pushrbx linked a pull request Apr 9, 2024 that will close this issue
@pushrbx pushrbx self-assigned this Apr 10, 2024
pushrbx added a commit that referenced this issue May 26, 2024
- added a new parameter: "continuing"
- continuing items from previous seasons are now excluded by default
- should fix #521
pushrbx added a commit that referenced this issue May 31, 2024
- added a new parameter: "continuing"
- continuing items from previous seasons are now excluded by default
- should fix #521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants