Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -2
src/streamlit_app.py
CHANGED
|
@@ -289,7 +289,8 @@ def get_similar_content(content, n_recommendations=5):
|
|
| 289 |
st.write("Sample row:", sample_data['list'][0])
|
| 290 |
|
| 291 |
# Try finding by both show_id and title
|
| 292 |
-
|
|
|
|
| 293 |
params = {
|
| 294 |
"where": query
|
| 295 |
}
|
|
@@ -321,7 +322,7 @@ def get_similar_content(content, n_recommendations=5):
|
|
| 321 |
for item in similar_items:
|
| 322 |
# Query main content table for full details using show_id
|
| 323 |
show_id = item.get('show_id', '')
|
| 324 |
-
query = f'where=(show_id,eq,{show_id})'
|
| 325 |
content_params = {
|
| 326 |
"where": query
|
| 327 |
}
|
|
|
|
| 289 |
st.write("Sample row:", sample_data['list'][0])
|
| 290 |
|
| 291 |
# Try finding by both show_id and title
|
| 292 |
+
escaped_title = title.replace('"', '\\"') # Escape any quotes in the title
|
| 293 |
+
query = f'where=(show_id,eq,{show_id})~and(title,eq,"{escaped_title}")' # Add quotes around title
|
| 294 |
params = {
|
| 295 |
"where": query
|
| 296 |
}
|
|
|
|
| 322 |
for item in similar_items:
|
| 323 |
# Query main content table for full details using show_id
|
| 324 |
show_id = item.get('show_id', '')
|
| 325 |
+
query = f'where=(show_id,eq,"{show_id}")' # Add quotes around show_id
|
| 326 |
content_params = {
|
| 327 |
"where": query
|
| 328 |
}
|