Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +22 -23
src/streamlit_app.py
CHANGED
|
@@ -374,31 +374,30 @@ elif search_query:
|
|
| 374 |
</style>
|
| 375 |
""", unsafe_allow_html=True)
|
| 376 |
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
</details>
|
| 398 |
</div>
|
| 399 |
</div>
|
| 400 |
-
|
| 401 |
-
|
| 402 |
|
| 403 |
else:
|
| 404 |
st.title("Welcome to Movie Recommender")
|
|
|
|
| 374 |
</style>
|
| 375 |
""", unsafe_allow_html=True)
|
| 376 |
|
| 377 |
+
for _, movie in filtered.iterrows():
|
| 378 |
+
poster_url, _ = get_tmdb_data(movie["clean_title"], movie["year"])
|
| 379 |
+
|
| 380 |
+
if not poster_url or "placeholder.com" in poster_url:
|
| 381 |
+
poster_html = """
|
| 382 |
+
<div style='width:100px;height:150px;border:2px dashed gray;display:flex;align-items:center;justify-content:center;color:gray;font-size:12px;'>No<br>Image</div>
|
| 383 |
+
"""
|
| 384 |
+
else:
|
| 385 |
+
poster_html = f"<img src='{poster_url}' class='poster'>"
|
| 386 |
+
|
| 387 |
+
st.markdown(f"""
|
| 388 |
+
<div class="movie-box">
|
| 389 |
+
{poster_html}
|
| 390 |
+
<div class="movie-content">
|
| 391 |
+
<div class="movie-title">
|
| 392 |
+
<a href='/?movie_id={movie["movieId"]}' class="movie-link">🎬 {movie['clean_title']}</a>
|
| 393 |
+
</div>
|
| 394 |
+
<div class="movie-details">
|
| 395 |
+
<p><strong>Genres:</strong> {movie['genres']}</p>
|
| 396 |
+
<p><strong>Year:</strong> {movie['year']}</p>
|
|
|
|
| 397 |
</div>
|
| 398 |
</div>
|
| 399 |
+
</div>
|
| 400 |
+
""", unsafe_allow_html=True)
|
| 401 |
|
| 402 |
else:
|
| 403 |
st.title("Welcome to Movie Recommender")
|