Spaces:
Sleeping
Sleeping
Moiz
commited on
Commit
·
230d12a
1
Parent(s):
d3ad890
removed placeholder made posters bigger
Browse files
app.py
CHANGED
@@ -53,15 +53,20 @@ def display_movie(action, profile):
|
|
53 |
# Extract movie details
|
54 |
movie = data_df.iloc[current_index[0]]
|
55 |
|
56 |
-
# Get the IMDb ID
|
57 |
movie_id = movie.get('id', 'Unknown') # Use 'Unknown' if 'id' doesn't exist
|
|
|
58 |
|
59 |
-
#
|
60 |
-
|
|
|
|
|
|
|
|
|
61 |
|
62 |
details = {
|
63 |
"title": f'<a href="https://www.imdb.com/title/{movie_id}/" target="_blank" style="font-size: 36px; text-decoration: none; color: inherit; font-family: Arial, sans-serif;">{movie["Title"]}</a>',
|
64 |
-
"
|
65 |
"ratings": f"""
|
66 |
<div style="display: flex; gap: 15px; align-items: center; text-align: center;">
|
67 |
<div>
|
@@ -90,9 +95,9 @@ def display_movie(action, profile):
|
|
90 |
**Box Office:** {movie['BoxOffice']}
|
91 |
""",
|
92 |
"current_rating": f"Your Rating: {movie[profile]}",
|
93 |
-
"index_display": f'<span class="index-display">{current_index[0] + 1}/{len(data_df)}</span>'
|
94 |
}
|
95 |
-
return details["title"], details["
|
96 |
|
97 |
def submit_rating(rating):
|
98 |
# Update the rating for the current profile and movie
|
|
|
53 |
# Extract movie details
|
54 |
movie = data_df.iloc[current_index[0]]
|
55 |
|
56 |
+
# Get the IMDb ID and Poster URL
|
57 |
movie_id = movie.get('id', 'Unknown') # Use 'Unknown' if 'id' doesn't exist
|
58 |
+
poster_url = movie.get("Poster", None) # Default to None if Poster is missing
|
59 |
|
60 |
+
# Use default text if no poster URL is available
|
61 |
+
poster_content = (
|
62 |
+
f'<img src="{poster_url}" alt="Poster" style="width: 100%; max-width: 500px; height: auto; border-radius: 10px;"/>'
|
63 |
+
if poster_url
|
64 |
+
else "Poster not available"
|
65 |
+
)
|
66 |
|
67 |
details = {
|
68 |
"title": f'<a href="https://www.imdb.com/title/{movie_id}/" target="_blank" style="font-size: 36px; text-decoration: none; color: inherit; font-family: Arial, sans-serif;">{movie["Title"]}</a>',
|
69 |
+
"poster_content": poster_content,
|
70 |
"ratings": f"""
|
71 |
<div style="display: flex; gap: 15px; align-items: center; text-align: center;">
|
72 |
<div>
|
|
|
95 |
**Box Office:** {movie['BoxOffice']}
|
96 |
""",
|
97 |
"current_rating": f"Your Rating: {movie[profile]}",
|
98 |
+
"index_display": f'<span class="index-display">{current_index[0] + 1}/{len(data_df)}</span>'
|
99 |
}
|
100 |
+
return details["title"], details["poster_content"], details["ratings"], details["details"], details["current_rating"], details["index_display"]
|
101 |
|
102 |
def submit_rating(rating):
|
103 |
# Update the rating for the current profile and movie
|