Closed revam closed 1 year ago
Please notice, that getting the whole graph from anidb requires multiple anidb API calls, one for every relation the series has. If I'm not wrong. Currently, Shoko graphs only the ones that already have.
So, what would be best, 1) expose only local relations, or 2) map the rest of the graph, potentially downloading the metadata for series not stored on disk, or 3) expose all relations in Shoko's database, with a setting to download all metadata for series not stored on disk. Personally I lean on option three or one.
@maxpiva What do you think?
Number three is great, but we already discussed this: Please check Shoko.Server/Models/SVR_AniDB_Anime.cs#L1342
Personally, I use a depth of 3, and since I usually have at least all of the seasons (and maybe not all ovas), I'll have the entire tree
We have /api/v3/Series/<shoko series id>/Relations
, /api/v3/Series/AniDB/<anidb series id>/Relations
, and /api/v3/Group/<shoko group id>/Relations
, which is good enough and can be used to crawl the relations client-side to create a graph, so closing this for now. I'm actually using the first endpoint I mentioned already in Shokofin to get the relations for the series.
Posting here because I was told to in Discord.
I think it would be cool to query once for a relation-graph containing all relations (both directly and indirectly) to a series.
Suggested implemention
Expose an endpoint that returns all relations that touch the series at some point (directly or indirectly), made possible by grouping all relations stored
AniDB_Anime_Relation
in a new table (AniDB_Anime_Relation_List
?) and querying for the group/list that contain the series id, then returning all relations (fromAniDB_Anime_Relation
) in that group/list.Example endpoint
/api/v3/Series/{id}/Graph
or maybe/api/v3/Graph/FromSeries/{seriesId}
Example responses
1) A graph was found
GET /api/v3/Series/1/Graph
, orGET /api/v3/Series/2/Graph
, orGET /api/v3/Series/3/Graph
2) A graph was not found
GET /api/v3/Series/0/Graph
Expected use-case:
General use-cases (e.g. media server integrations. desktop)
Offline use-cases (e.g. desktop, or LAN only)