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
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 robbie3999
on July 14, 2023 at 3:55 PM
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: