Assistance de TMDB

Hi Im currently writing a function within a programm where i would like to display a picture of an actor. since i have invalid actor ID' s and cant change the dataset im using, i need to search them by name where i recive a json object which looks somewhat like that:

{
    "page": 1,
    "results": [
        {
            "adult": false,
            "gender": 2,
            "id": 2458619,
            "known_for_department": "Acting",
            "name": "Chino 'Fats' Williams",
            "original_name": "Chino 'Fats' Williams",
            "popularity": 4.205,
            "profile_path": "/uBjys56191sxDRo8qPaBPwJpUfX.jpg",
            "known_for": [
                {
                    "adult": false,
                    "backdrop_path": "/wh4ze6klUbeichAj603OKZwY1W5.jpg",
                    "id": 218,
                    "title": "The Terminator",
                    "original_language": "en",
                    "original_title": "The Terminator",
                    "overview": "In the post-apocalyptic future, reigning tyrannical supercomputers teleport a cyborg assassin known as the \"Terminator\" back to 1984 to kill Sarah Connor, whose unborn son is destined to lead insurgents against 21st century mechanical hegemony. Meanwhile, the human-resistance movement dispatches a lone warrior to safeguard Sarah. Can he stop the virtually indestructible killing machine?",
                    "poster_path": "/hzXSE66v6KthZ8nPoLZmsi2G05j.jpg",
                    "media_type": "movie",
                    "genre_ids": [
                        28,
                        53,
                        878
                    ],
                    "popularity": 52.657,
                    "release_date": "1984-10-26",
                    "video": false,
                    "vote_average": 7.642,
                    "vote_count": 11633
                },
                {
                    "adult": false,
                    "backdrop_path": "/1T7d8EuYnpZRc3yHxqa3vipZ2DE.jpg",
                    "id": 1371,
                    "title": "Rocky III",
                    "original_language": "en",
                    "original_title": "Rocky III",
                    "overview": "Now the world champion, Rocky Balboa is living in luxury and only fighting opponents who pose no threat to him in the ring, until Clubber Lang challenges him to a bout. After taking a pounding from Lang, the humbled champ turns to former bitter rival Apollo Creed for a rematch with Lang.",
                    "poster_path": "/3avfzaUDxMieyEgGPopVvh8ABXR.jpg",
                    "media_type": "movie",
                    "genre_ids": [
                        18
                    ],
                    "popularity": 42.018,
                    "release_date": "1982-05-28",
                    "video": false,
                    "vote_average": 6.866,
                    "vote_count": 3654
                },
                {
                    "adult": false,
                    "backdrop_path": "/jOWqY02m10vDRYHhYGivgV10OtZ.jpg",
                    "id": 11814,
                    "title": "Weird Science",
                    "original_language": "en",
                    "original_title": "Weird Science",
                    "overview": "Two unpopular teenagers, Gary and Wyatt, fail at all attempts to be accepted by their peers. Their desperation to be liked leads them to \"create\" a woman via their computer. Their living and breathing creation is a gorgeous woman, Lisa, whose purpose is to boost their confidence level by putting them into situations which require Gary and Wyatt to act like men.",
                    "poster_path": "/jaEauZd2joSAKn42D83gm3S0y3F.jpg",
                    "media_type": "movie",
                    "genre_ids": [
                        35,
                        10749,
                        878
                    ],
                    "popularity": 18.433,
                    "release_date": "1985-08-01",
                    "video": false,
                    "vote_average": 6.534,
                    "vote_count": 1220
                }
            ]
        }
    ],
    "total_pages": 1,
    "total_results": 1
}

I am only interested in the profile_path but have tried for hours to access that and cant get it done. I need to utilize angular > v6.0

thanks in advance Benedict Grünberg

1 réponse (sur la page 1 sur 1)

Jump to last post

Hi @bt718936, this document describes how to construct a correct path for an image.

For example, the profile_path from your output in original size:

http://image.tmdb.org/t/p/original/uBjys56191sxDRo8qPaBPwJpUfX.jpg

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