thetvdb / v4-api

Founded in 2006, TheTVDB is one of the longest-running community-driven TV and Movie databases. With content metadata across hundreds of thousands of TV series and movies, TheTVDB powers many of the largest media centers in the market. Developers across the world build and rely upon TheTVDB's APIs to power their apps, utilities, and projects, generating millions of API calls per day. In our GitHub repository you will find all of the necessary support and v4 API documentation to make use of TheTVDB's metadata. Come and join us!
135 stars 13 forks source link

Any way to avoid N+1 requests to get season/episode names in a specific language? #276

Open paddycarver opened 1 year ago

paddycarver commented 1 year ago

What I'm doing right now, to get a list of seasons for a show and a list of episodes for a show, is using the extended endpoints of the series and season types. These helpfully give me a list of seasons and episodes, respectfully.

However, it's always in the official language for the show, and I'd like to consistently get it in English.

How I'm achieving this right now is sending another request to the season translations/episode translations endpoint for English. Which works great! It's just that it requires N+1 requests (1 request to get the list, 1 request per item in the list). Worse, because I can't seem to find any indication of what the official language for the show is, I have to do these translation requests even for things already in English.

This is fine for me, but I assume I would be being a better consumer of the API if I avoided the N+1 requests, even though my use is pretty minimal and likely unnoticeable. Is there a way for me to go about doing that that I'm missing?

antheaezzell commented 1 year ago

@paddycarver please use this /series/:id/episodes/:seasonType/:language endpoint As an example, for Battlestar Galactica you can use https://api4.thetvdb.com/v4/series/73545/episodes/default/eng?page=0 Hope that helps!

paddycarver commented 1 year ago

This seems to be only for all episodes in an entire series, and not filterable to just one season, is that right? Or am I missing something?

This also seems to not give me season names; is there a similar endpoint for season names?

antheaezzell commented 1 year ago

@paddycarver we have ticketed the inclusion of this enhancement and I'll be in touch when it is available.

Internal ticket for our reference - https://mediamorph.atlassian.net/browse/TVD-3691

darthShadow commented 3 months ago

Is there any further update on an API to fetch all the season translations in a specific language rather than doing it 1 by 1?

Just asking because it's been more than a year since the last update about the internal ticket.

joerex1418 commented 2 months ago

Would also like to get a nudge on this ticket. I'm having similar hardships. A lot of hoops to jump through just for retrieving translations.