lenawilli commited on
Commit
459f1e3
·
verified ·
1 Parent(s): 1898fe7

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- col1, col2 = st.columns([1, 3])
306
- with col1:
307
- poster_url, _ = get_tmdb_data(movie["clean_title"], movie["year"])
308
- if poster_url and "placeholder.com" not in poster_url:
309
- st.image(poster_url, width=150)
310
- else:
311
- st.markdown("""
312
- <div style='width:150px;border:2px dashed gray;height:225px;display:flex;align-items:center;justify-content:center;color:gray;'>
313
- No picture available
314
- </div>
315
- """, unsafe_allow_html=True)
316
- with col2:
317
- st.subheader(movie["clean_title"])
318
- st.write(f"Genres: {movie['genres']}")
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