Assistance de TMDB

Here I see the list of Genres with id numbers: https://developers.themoviedb.org/3/genres/get-movie-list

(1) So for example, looking at the snippet below, I wanted to know why the genre id numbers are random, why not make the genre id's number follow an order like 1,2,3,4,5 etc. why make random numbers? ... I am learning so I am trying to understand why its like this.

{
  "genres": [
    {
      "id": 28,
      "name": "Action"
    },
    {
      "id": 12,
      "name": "Adventure"
    },
    {
      "id": 16,
      "name": "Animation"
    },
    {
      "id": 35,
      "name": "Comedy"
    }, ...

(2) I know that I would use an API call like (https://api.themoviedb.org/3/movie/437557?api_key=KEY ) to get the details of one particular movie, and inside of that details object we have the genres of that one particular movie. So what situation would someone want to call just - https://api.themoviedb.org/3/genre/movie/list?api_key=KEY , and just get a list of the generic genres object we have above ?

Thank you for your help! :-)

2 réponses (sur la page 1 sur 1)

Jump to last post

Hi there,

So for example, looking at the snippet below, I wanted to know why the genre id numbers are random, why not make the genre id's number follow an order like 1,2,3,4,5 etc. why make random numbers?

They aren't really random, there's lots of genres that have either been deleted or disabled over the years. The table started at 1 and incremented up.

So what situation would someone want to call just - https://api.themoviedb.org/3/genre/movie/list?api_key=KEY , and just get a list of the generic genres object we have above?

While it's true that the get details method returns a human readable name, none of the list methods do (popular, top rated, discover, etc...) So the usual practice would be to store the genres locally and then you can reference them like any other linked object.

Thank you.

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion