Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -17
src/streamlit_app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import requests
|
| 3 |
-
import pandas as pd
|
| 4 |
from together import Together
|
| 5 |
import os
|
| 6 |
import json
|
|
@@ -196,23 +195,12 @@ def create_content_context(content_list):
|
|
| 196 |
movies = sum(1 for c in content_list if c.get('type') == 'Movie')
|
| 197 |
shows = sum(1 for c in content_list if c.get('type') == 'TV Show')
|
| 198 |
|
| 199 |
-
context = f"""Currently showing {total} titles ({movies} movies and {shows} TV shows)
|
| 200 |
|
| 201 |
-
# Add
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
all_genres.extend(genres)
|
| 206 |
-
|
| 207 |
-
if all_genres:
|
| 208 |
-
genre_counts = pd.Series(all_genres).value_counts()
|
| 209 |
-
top_genres = genre_counts.head(5).index.tolist()
|
| 210 |
-
context += f"Top genres include: {', '.join(top_genres)}. "
|
| 211 |
-
|
| 212 |
-
# Add year range
|
| 213 |
-
years = [int(c.get('release_year', 0)) for c in content_list if c.get('release_year')]
|
| 214 |
-
if years:
|
| 215 |
-
context += f"Release years range from {min(years)} to {max(years)}."
|
| 216 |
|
| 217 |
return context
|
| 218 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import requests
|
|
|
|
| 3 |
from together import Together
|
| 4 |
import os
|
| 5 |
import json
|
|
|
|
| 195 |
movies = sum(1 for c in content_list if c.get('type') == 'Movie')
|
| 196 |
shows = sum(1 for c in content_list if c.get('type') == 'TV Show')
|
| 197 |
|
| 198 |
+
context = f"""Currently showing {total} titles ({movies} movies and {shows} TV shows) """
|
| 199 |
|
| 200 |
+
# Add streaming services info
|
| 201 |
+
services = set(c.get('streaming_service') for c in content_list if c.get('streaming_service'))
|
| 202 |
+
if services:
|
| 203 |
+
context += f"available on {', '.join(services)}. "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
return context
|
| 206 |
|