Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +15 -16
src/streamlit_app.py
CHANGED
|
@@ -298,26 +298,25 @@ elif page:
|
|
| 298 |
elif search_query:
|
| 299 |
st.title(f"Search Results for '{search_query}'")
|
| 300 |
filtered = movie_df[movie_df["clean_title"].str.contains(search_query, case=False, na=False)]
|
|
|
|
| 301 |
if filtered.empty:
|
| 302 |
st.warning("No movies found.")
|
| 303 |
else:
|
| 304 |
for _, movie in filtered.iterrows():
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
No picture
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
st.write(f"Year: {movie['year']}")
|
| 320 |
-
st.markdown(f"[Details](/?movie_id={movie['movieId']})", unsafe_allow_html=True)
|
| 321 |
else:
|
| 322 |
st.title("Welcome to Movie Recommender")
|
| 323 |
|
|
|
|
| 298 |
elif search_query:
|
| 299 |
st.title(f"Search Results for '{search_query}'")
|
| 300 |
filtered = movie_df[movie_df["clean_title"].str.contains(search_query, case=False, na=False)]
|
| 301 |
+
|
| 302 |
if filtered.empty:
|
| 303 |
st.warning("No movies found.")
|
| 304 |
else:
|
| 305 |
for _, movie in filtered.iterrows():
|
| 306 |
+
with st.expander(f"{movie['clean_title']}"):
|
| 307 |
+
col1, col2 = st.columns([1, 3])
|
| 308 |
+
with col1:
|
| 309 |
+
poster_url, _ = get_tmdb_data(movie["clean_title"], movie["year"])
|
| 310 |
+
if poster_url and "placeholder.com" not in poster_url:
|
| 311 |
+
st.image(poster_url, width=100)
|
| 312 |
+
else:
|
| 313 |
+
st.markdown("""
|
| 314 |
+
<div style='width:100px;border:2px dashed gray;height:150px;display:flex;align-items:center;justify-content:center;color:gray;font-size:12px;'>No picture<br>available</div>
|
| 315 |
+
""", unsafe_allow_html=True)
|
| 316 |
+
with col2:
|
| 317 |
+
st.markdown(f"**Genres:** {movie['genres']}")
|
| 318 |
+
st.markdown(f"**Year:** {movie['year']}")
|
| 319 |
+
st.markdown(f"[Details](/?movie_id={movie['movieId']})", unsafe_allow_html=True)
|
|
|
|
|
|
|
| 320 |
else:
|
| 321 |
st.title("Welcome to Movie Recommender")
|
| 322 |
|