-
Notifications
You must be signed in to change notification settings - Fork 15
Description
The Agent is currently only using the mal_id, title and aired_date as metadata for episodes. This should be expanded to other relevant metadata like the episode synopsis. This is currently not feasible because of how the JikanAPI provides the metadata.
The JikanAPI has two ways of requesting episode information, through the /episodes and the /episodes/X endpoints. But as the table below shows, the information provided on each endpoint is not consistent.
| field | /episodes | /episodes/X |
|---|---|---|
| mal_id | x | x |
| url | x | x |
| title | x | x |
| title_japanese | x | x |
| title_romanji | x | x |
| aired | x | x |
| score | x | |
| filler | x | x |
| recap | x | x |
| forum_url | x | |
| duration | x | |
| synopsis | x |
From what I could gather is that this is because of how MyAnimeList provides the information and the JikanAPI only parses the websites 1:1.
This means that to get a full set of metadata, you would need to do more requests than necessary.
- 1 request for each page of the episode list to get things like the
scoreorforum_url - 1 request for each individual episode to get
durationandsynopsis
For long-running like One Piece this would mean the following: at 1065 episodes, the agent would need to do 1065 individual requests for each episode and 11 requests for each episode's list page. That would result in 1076 requests in total. At the Rate limit of 3 requests each second this would take roughly 6 minutes to populate.
However, while it is possible to restrict requests made by the agent and make sure that they don't go over the request limits, those are only for a single request. Any "multi" refreshes in the library would inadvertently run into the "too many requests" error.
This also would only consider the episodes, but the agent needs to do a few more requests: search, details, characters, pictures, person details and character details (as possible additional requests).
Reducing the number of requests done each second to have enough buffer for other refreshes of metadata would only lengthen the time needed for a single library item to update (Example: 1 request each second at 1076 requests for episodes + the other 6 requests would take 1082 seconds so 18 minutes for one piece to update, if completely successful)
Hopefully, Jikan can rework the way episodes are being parsed and handled internally so that it would be easier for them to join the information together and also provide them on the episode list endpoint jikan-me/jikan-rest#341