Spaces:
Sleeping
Sleeping
Commit
·
37d2ac3
1
Parent(s):
31d5c3d
fix route
Browse files
app.py
CHANGED
|
@@ -76,13 +76,15 @@ async def get_tv_metadata_api(title: str):
|
|
| 76 |
|
| 77 |
raise HTTPException(status_code=404, detail="Metadata not found")
|
| 78 |
|
|
|
|
| 79 |
@app.get("/api/get/tv/metadata/{series_id}/{season}")
|
| 80 |
async def get_season_metadata_api(series_id: int, season: str):
|
| 81 |
"""Endpoint to get the TV show season metadata by id and season."""
|
| 82 |
if not season:
|
| 83 |
raise HTTPException(status_code=400, detail="Season must be provided and cannot be empty")
|
| 84 |
|
| 85 |
-
|
|
|
|
| 86 |
print(json_cache_path)
|
| 87 |
|
| 88 |
if os.path.exists(json_cache_path):
|
|
|
|
| 76 |
|
| 77 |
raise HTTPException(status_code=404, detail="Metadata not found")
|
| 78 |
|
| 79 |
+
|
| 80 |
@app.get("/api/get/tv/metadata/{series_id}/{season}")
|
| 81 |
async def get_season_metadata_api(series_id: int, season: str):
|
| 82 |
"""Endpoint to get the TV show season metadata by id and season."""
|
| 83 |
if not season:
|
| 84 |
raise HTTPException(status_code=400, detail="Season must be provided and cannot be empty")
|
| 85 |
|
| 86 |
+
# Convert series_id to string before joining the path
|
| 87 |
+
json_cache_path = os.path.join(CACHE_DIR, "metadata", str(series_id), f"{season}.json")
|
| 88 |
print(json_cache_path)
|
| 89 |
|
| 90 |
if os.path.exists(json_cache_path):
|