Update main.py

This commit is contained in:
TylerCG 2025-05-12 18:33:15 -04:00
parent 2c842e79ad
commit 017fa799ce

View File

@ -102,14 +102,14 @@ async def dropoutSeries():
except:
return JSONResponse(content={"error": "File not found"}, status_code=404)
async def get_show_data(show: str):
async def get_show_data(show: str, force: bool = False):
global cached_data
if cached_data is None:
await dropoutUpdate()
for item in cached_data:
if show == item["SHOW"] or show == item["LINK"]:
if "SEASONS" not in item:
if "SEASONS" not in item or force is not False:
item['SEASONS'] = download.grab.season(item['URL'])
return item
return None
@ -134,7 +134,7 @@ async def dropoutDownload(
):
try:
if latest is not False and season is None:
item = await get_show_data(show)
item = await get_show_data(show,True)
if not item:
return JSONResponse(status_code=404, content={"status": "error", "message": "Show not found"})
season = get_latest_season(item)