Assistance de TMDB

Using the above as an example, the name field is returned as an empty string. Should it return the original name for each language?

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

Jump to last post

Which field are you referring to exactly, the name field? Here's an example request I just did, the field is being returned... thinking

Request

curl -v "https://api.themoviedb.org/3/tv/94653?api_key=###"

* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f9ef880e600)
> GET /3/tv/94653?api_key=### HTTP/2
> Host: api.themoviedb.org
> user-agent: curl/7.72.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: application/json;charset=utf-8
< content-length: 1764
< date: Mon, 21 Sep 2020 22:05:27 GMT
< server: openresty
< access-control-allow-origin: *
< access-control-allow-methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
< access-control-expose-headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, Content-Length, Content-Range
< cache-control: public, max-age=3600
< x-memc: HIT
< x-memc-key: 32460cd7a3200cf3b4addcf36bd23d91
< x-memc-age: 91
< x-memc-expires: 3509
< etag: W/"1528b4a2f5718ea5be0a6a01f13f7adb"
< last-modified: Mon, 21 Sep 2020 22:05:27 GMT
< vary: Accept-Encoding,Accept-Encoding,Accept-Encoding
< x-cache: Miss from cloudfront
< via: 1.1 aa79182fd8d89401a4b0b62c8e776d07.cloudfront.net (CloudFront)
< x-amz-cf-pop: HIO51-C1
< x-amz-cf-id: IgPzazW2amd2vL14m7bJwqFYkufHXkE1uC_ILuwYebToPIxQRKfMhg==
<
* Connection #0 to host api.themoviedb.org left intact

Response

{
  "backdrop_path": "/39vlU0wiQ05OZuqkaVI9Iv6mKLP.jpg",
  "created_by": [],
  "episode_run_time": [
    45
  ],
  "first_air_date": "2019-10-17",
  "genres": [
    {
      "id": 35,
      "name": "Comedy"
    },
    {
      "id": 10764,
      "name": "Reality"
    },
    {
      "id": 10767,
      "name": "Talk"
    }
  ],
  "homepage": "https://www.dplay.no/programmer/kongen-befaler",
  "id": 94653,
  "in_production": true,
  "languages": [
    "no"
  ],
  "last_air_date": "2019-12-19",
  "last_episode_to_air": {
    "air_date": "2019-12-19",
    "episode_number": 10,
    "id": 2160416,
    "name": "Episode 10",
    "overview": "",
    "production_code": "",
    "season_number": 1,
    "show_id": 94653,
    "still_path": null,
    "vote_average": 0.0,
    "vote_count": 0
  },
  "name": "Kongen befaler",
  "next_episode_to_air": {
    "air_date": "2020-09-24",
    "episode_number": 1,
    "id": 2425986,
    "name": "Episode 1",
    "overview": "",
    "production_code": "",
    "season_number": 2,
    "show_id": 94653,
    "still_path": null,
    "vote_average": 0.0,
    "vote_count": 0
  },
  "networks": [
    {
      "name": "TVNorge",
      "id": 157,
      "logo_path": "/v25T1fvtINzeQMC1AdwFPwOL1no.png",
      "origin_country": "NO"
    }
  ],
  "number_of_episodes": 11,
  "number_of_seasons": 2,
  "origin_country": [
    "NO"
  ],
  "original_language": "no",
  "original_name": "Kongen befaler",
  "overview": "Atle Antonsen has invited five of Norway's best comedians to solve a number of tasks.",
  "popularity": 13.21,
  "poster_path": "/6LG5d36oqv6b4vkyCgfdCW2tUPD.jpg",
  "production_companies": [
    {
      "id": 6992,
      "logo_path": null,
      "name": "Avalon",
      "origin_country": ""
    },
    {
      "id": 98683,
      "logo_path": "/4iElhsYOUjLR7IlfNUsLXvtMUhH.png",
      "name": "Concorde TV",
      "origin_country": "NO"
    }
  ],
  "seasons": [
    {
      "air_date": "2019-10-17",
      "episode_count": 10,
      "id": 134298,
      "name": "Season 1",
      "overview": "",
      "poster_path": null,
      "season_number": 1
    },
    {
      "air_date": "2020-09-24",
      "episode_count": 1,
      "id": 162485,
      "name": "Season 2",
      "overview": "",
      "poster_path": null,
      "season_number": 2
    }
  ],
  "status": "Returning Series",
  "type": "Talk Show",
  "vote_average": 9.0,
  "vote_count": 1
}

It's actually the translations API, here's a full example. I think I found the reason, it uses the translated name field, so if that is blank for the locale, the API also returns a blank string. Maybe this can fall back to the original name if the translated name is blank? or the original name can also be included?

In the example below, I filled in the translated name (used the same value as original name) and the name field is there for the Norwegian translation.

Request


curl -i "https://api.themoviedb.org/3/tv/94653/translations?api_key=###"
HTTP/2 200
content-type: application/json;charset=utf-8
content-length: 1151
date: Mon, 21 Sep 2020 22:23:51 GMT
server: openresty
access-control-allow-origin: *
access-control-allow-methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
access-control-expose-headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, Content-Length, Content-Range
cache-control: public, max-age=21600
x-memc: MISS, STORE
x-memc-key: bc068010caca6547bb4d466d3b72080e
x-memc-age: 0
x-memc-expires: 21600
last-modified: 2020-09-14 03:04:13 UTC
vary: Accept-Encoding,Accept-Encoding,Accept-Encoding
x-cache: Miss from cloudfront
via: 1.1 f94de31c777bc3bf7b8976bac21b4483.cloudfront.net (CloudFront)
x-amz-cf-pop: SFO20-C1
x-amz-cf-id: WmV1_My_p28hijFKBrniO5F9ZpiIDI9ncQUBKWO_btroT7vPYoG5xA==

Response


{
  "id":94653,
  "translations":[
    {
      "iso_3166_1":"US",
      "iso_639_1":"en",
      "name":"English",
      "english_name":"English",
      "data":{
        "name":"",
        "overview":"Atle Antonsen has invited five of Norway's best comedians to solve a number of tasks.",
        "homepage":"",
        "tagline":""
      }
    },
    {
      "iso_3166_1":"NO",
      "iso_639_1":"no",
      "name":"Norsk",
      "english_name":"Norwegian",
      "data":{
        "name":"Kongen befaler",
        "overview":"Atle Antonsen inntar rollen som den allmektige kongen med Olli Wermskog som assistent. I hvert program deler han ut absurde praktiske oppgaver og utfordringer til Bård og Vegard Ylvisåker, Calle Hellevang-Larsen, Siri Kristiansen og Maria «Piateed» Stavang som humoristene må løse på mest mulig kreativt og effektivt vis. Skitne triks og bestikkelser er lov underveis, og når alt er sagt og gjort –og all verdighet er blåst bort –er det opp til Atle Antonsen å bestemme hvem som er ukens vinner.\n\nNår Kongen befaler er tilbake på tv denne høsten, blir det både gamle og nye fjes som skal utføre Atles bisarre utfordringer. Årets deltakere er Jon Almaas, Calle Hellevang-Larsen, Maria Stavang, Magnus Devold og Mia Hundvind.",
        "homepage":"",
        "tagline":""
      }
    }
  ]
}

Ah in that case, this is expected. We can only display the data that has been entered. It's the same as the data you can see being returned here.

Ok gotcha, thanks for the info. I'll just have users fill in the translated fields with the correct info and that should address the missing data they are seeing. Thanks!

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