Fribb / MyAnimeList.bundle

Plex Media Server Metadata Agent for MyAnimeList.net
148 stars 15 forks source link

Additional Metadata for episodes #40

Open Fribb opened 1 year ago

Fribb commented 1 year ago

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.

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 https://github.com/jikan-me/jikan-rest/issues/341

Tama47 commented 1 year ago

This is exactly what I'm looking for, as MAL often has many missing episode titles. I have to copy & paste metadata manually from sources like Crunchyroll and HiDive. I also have to save thumbnails locally, as the ones generated by Plex are less than ideal. I wonder if there's a way to pull those metadata directly?

HiDive:

Screenshot 2023-03-06 at 3 02 47 PM Screenshot 2023-03-06 at 3 03 10 PM Screenshot 2023-03-06 at 3 03 48 PM

Crunchyroll:

Screenshot 2023-03-06 at 3 06 20 PM Screenshot 2023-03-06 at 3 06 36 PM
Fribb commented 1 year ago

I think your issue is unrelated to the actual topic of this issue. This is more about adding the functionality to add the episode-related Metadata like the episode synopsis to plex when Jikan makes requesting this more convenient but not by adding more metadata sources to the agent!

This Agents main purpose is to request metadata from MyAnimeList exclusively. There is an exception to that rule by requesting additional image-based metadata from other sources like TheMovieDB and TheTVDB for Banners, additional Posters and background images. But that is it.

Still, using different sources for Metadata like from Hidive or Crunchyroll is not planned. I don't even think that they provide an API to request that information anyway.

My thinking is the following: We shouldn't start to expand the Agent with additional ways of requesting metadata, this is just making the Agent unnecessarily complex.

Especially under the aspect that you could just add the missing Metadata to MyAnimeList which will then make its way to the API and into your library with the Agent. This would also benefit everyone else than just you yourself and your own library.

Tama47 commented 1 year ago

I think your issue is unrelated to the actual topic of this issue. This is more about adding the functionality to add the episode-related Metadata like the episode synopsis to plex when Jikan makes requesting this more convenient but not by adding more metadata sources to the agent!

This Agents main purpose is to request metadata from MyAnimeList exclusively. There is an exception to that rule by requesting additional image-based metadata from other sources like TheMovieDB and TheTVDB for Banners, additional Posters and background images. But that is it.

Sorry, I misunderstood the issue. I have no idea how the Jikan API actually works.

Still, using different sources for Metadata like from Hidive or Crunchyroll is not planned. I don't even think that they provide an API to request that information anyway.

My thinking is the following: We shouldn't start to expand the Agent with additional ways of requesting metadata, this is just making the Agent unnecessarily complex.

Especially under the aspect that you could just add the missing Metadata to MyAnimeList which will then make its way to the API and into your library with the Agent. This would also benefit everyone else than just you yourself and your own library.

While this is true, and I would love to add some of these entries to MAL myself, how do I even do that? Moreover, even if I can add entries myself, there are way too many entries to add. Especially for newer anime, where most of the episode titles are missing in MAL but exist from sources. Also I believe an API exists? I usually get my episode title metadata with yt-dlp from Crunchyroll. I just think it may be more efficient to obtain these metadata directly from sources since they have it right away, rather than waiting for someone to maybe add them to MAL.

Fribb commented 1 year ago

While it definitely would be more efficient, this Agent is called "MyAnimeList Metadata Agent for a reason". If you want the metadata "directly from the source" (Hidive or Crunchyroll) then this isn't really MyAnimeList anymore and therefore out of the scope of the Agent.

Therefore, if you want to have metadata from a different source you need to look for a way to get that from that source and not by adding that functionality to a different agent.

If you want to discuss this further I would suggest opening a discussion thread for this but not as part of this issue though my standpoint is clear, this won't be added to the Agent. Thank you.