Hi Travis,
I was wondering how difficult it would be for the discover
endpoints for Movies and TV to return array[object]
for Genres, similar to the details
endpoints?
Currently, array[integer]
is returned in the genre_ids
field. Returning the Genre objects themselves would be a huge help to many of us, and means we wouldn't have to make a separate call to the genre/{media}/list
endpoints and do internal mapping ourselves.
Is there a reason this is not done currently?
Cheers!
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on January 15, 2020 at 4:04 PM
If I could do it again, I'd actually do it in reverse (make everything follow the ID way). I don't like to have to do full translated object lookups for so many items all the time, when it's so easy to implement that logic client side.
Best thing to do is just cache the data for some amount of time (like a week or something) and then you can build a map locally.
Reply by terminaether
on January 16, 2020 at 4:03 AM
Appreciate the quick response, and I can understand your reasoning.
For my own use case (an Android app), I wanted to include the Genres for Movies/Shows in the list returned from the
discover
response. Unfortunately, trying to do that just goes against too many best practices and standards for it to be worth it. Seeing as thedetails
response returns the Genre names themselves, local mapping would only be used for a single section of the app, and never again.Again, I appreciate your approach and would agree that doing things in the reverse would end up being better overall. Thanks for all the work you do!