lenawilli commited on
Commit
4cd8dce
·
verified ·
1 Parent(s): 2682058

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- for _, movie in filtered.iterrows():
378
- poster_url, _ = get_tmdb_data(movie["clean_title"], movie["year"])
379
- if not poster_url or "placeholder.com" in poster_url:
380
- poster_html = """
381
- <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>
382
- """
383
- else:
384
- poster_html = f"<img src='{poster_url}' class='poster'>"
385
-
386
- st.markdown(f"""
387
- <div class="movie-box">
388
- {poster_html}
389
- <div class="movie-content">
390
- <details>
391
- <summary class="movie-title">🎬 {movie['clean_title']}</summary>
392
- <div class="movie-details">
393
- <p><strong>Genres:</strong> {movie['genres']}</p>
394
- <p><strong>Year:</strong> {movie['year']}</p>
395
- <a class="movie-link" href='/?movie_id={movie["movieId"]}'>🔍 Details</a>
396
- </div>
397
- </details>
398
  </div>
399
  </div>
400
- """, unsafe_allow_html=True)
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")