Spaces:
Running
Running
Update actor_info.py
Browse files- actor_info.py +4 -2
actor_info.py
CHANGED
|
@@ -17,7 +17,9 @@ def actor_it(id:int):
|
|
| 17 |
data=response.json()
|
| 18 |
gender_get='Male' if data.get('gender')==2 else 'Female'
|
| 19 |
movies = data.get("movie_credits", {}).get("cast", [])
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
work_list=[
|
| 22 |
{
|
| 23 |
'Id':movie.get('id'),
|
|
@@ -32,7 +34,7 @@ def actor_it(id:int):
|
|
| 32 |
)
|
| 33 |
|
| 34 |
}
|
| 35 |
-
for movie in
|
| 36 |
data_list.append({
|
| 37 |
'Name':data.get('name'),
|
| 38 |
'Profile_pic':f"https://image.tmdb.org/t/p/w500{data.get('profile_path')}",
|
|
|
|
| 17 |
data=response.json()
|
| 18 |
gender_get='Male' if data.get('gender')==2 else 'Female'
|
| 19 |
movies = data.get("movie_credits", {}).get("cast", [])
|
| 20 |
+
movie_length=len(movies)
|
| 21 |
+
if movie_length>8:
|
| 22 |
+
movie_length=8
|
| 23 |
work_list=[
|
| 24 |
{
|
| 25 |
'Id':movie.get('id'),
|
|
|
|
| 34 |
)
|
| 35 |
|
| 36 |
}
|
| 37 |
+
for movie in range(movie_length)]
|
| 38 |
data_list.append({
|
| 39 |
'Name':data.get('name'),
|
| 40 |
'Profile_pic':f"https://image.tmdb.org/t/p/w500{data.get('profile_path')}",
|