Spaces:
Sleeping
Sleeping
Commit
·
31d5c3d
1
Parent(s):
4a90a46
fix app.py
Browse files
app.py
CHANGED
|
@@ -76,13 +76,14 @@ 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/{
|
| 80 |
-
async def get_season_metadata_api(
|
| 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 |
-
json_cache_path = os.path.join(CACHE_DIR, f"
|
|
|
|
| 86 |
|
| 87 |
if os.path.exists(json_cache_path):
|
| 88 |
data = await read_json_file(json_cache_path)
|
|
|
|
| 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 |
+
json_cache_path = os.path.join(CACHE_DIR,"metadata", series_id,f"{urllib.parse.quote(season)}.json")
|
| 86 |
+
print(json_cache_path)
|
| 87 |
|
| 88 |
if os.path.exists(json_cache_path):
|
| 89 |
data = await read_json_file(json_cache_path)
|