Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -5
src/streamlit_app.py
CHANGED
|
@@ -272,7 +272,7 @@ elif page:
|
|
| 272 |
st.markdown(f"**Year:** {movie['year']}")
|
| 273 |
if tmdb_link:
|
| 274 |
st.markdown(f"<a href='{tmdb_link}' target='_blank'>π View on TMDb</a>", unsafe_allow_html=True)
|
| 275 |
-
st.markdown(f"<a href='/?movie_id={movie['movieId']}'>
|
| 276 |
|
| 277 |
st.markdown(f"### Movie {index + 1} of {len(movie_pool)}")
|
| 278 |
st.markdown("### Your Rating")
|
|
@@ -320,10 +320,10 @@ elif search_query:
|
|
| 320 |
strong_matches = movie_df[movie_df["match_score"] > 0].sort_values("match_score", ascending=False)
|
| 321 |
|
| 322 |
if strong_matches.empty:
|
| 323 |
-
close_titles = difflib.get_close_matches(search_query, movie_df["clean_title"], n=
|
| 324 |
-
filtered = movie_df[movie_df["clean_title"].isin(close_titles)]
|
| 325 |
else:
|
| 326 |
-
filtered = strong_matches
|
| 327 |
|
| 328 |
if filtered.empty:
|
| 329 |
st.warning("No movies found.")
|
|
@@ -394,7 +394,7 @@ elif search_query:
|
|
| 394 |
{poster_html}
|
| 395 |
<div class="movie-content">
|
| 396 |
<div class="movie-title">
|
| 397 |
-
<a href='/?movie_id={movie["movieId"]}' class="movie-link">
|
| 398 |
</div>
|
| 399 |
<div class="movie-details">
|
| 400 |
<p><strong>Genres:</strong> {movie['genres']}</p>
|
|
|
|
| 272 |
st.markdown(f"**Year:** {movie['year']}")
|
| 273 |
if tmdb_link:
|
| 274 |
st.markdown(f"<a href='{tmdb_link}' target='_blank'>π View on TMDb</a>", unsafe_allow_html=True)
|
| 275 |
+
st.markdown(f"<a href='/?movie_id={movie['movieId']}'>Details</a>", unsafe_allow_html=True)
|
| 276 |
|
| 277 |
st.markdown(f"### Movie {index + 1} of {len(movie_pool)}")
|
| 278 |
st.markdown("### Your Rating")
|
|
|
|
| 320 |
strong_matches = movie_df[movie_df["match_score"] > 0].sort_values("match_score", ascending=False)
|
| 321 |
|
| 322 |
if strong_matches.empty:
|
| 323 |
+
close_titles = difflib.get_close_matches(search_query, movie_df["clean_title"], n=25, cutoff=0.5)
|
| 324 |
+
filtered = movie_df[movie_df["clean_title"].isin(close_titles)].head(25)
|
| 325 |
else:
|
| 326 |
+
filtered = strong_matches.head(25)
|
| 327 |
|
| 328 |
if filtered.empty:
|
| 329 |
st.warning("No movies found.")
|
|
|
|
| 394 |
{poster_html}
|
| 395 |
<div class="movie-content">
|
| 396 |
<div class="movie-title">
|
| 397 |
+
<a href='/?movie_id={movie["movieId"]}' class="movie-link">{movie['clean_title']}</a>
|
| 398 |
</div>
|
| 399 |
<div class="movie-details">
|
| 400 |
<p><strong>Genres:</strong> {movie['genres']}</p>
|