Update main.py
This commit is contained in:
parent
4e59f628e3
commit
d458fcf63b
19
app/main.py
19
app/main.py
@ -102,16 +102,15 @@ async def dropoutSeries():
|
|||||||
except:
|
except:
|
||||||
return JSONResponse(content={"error": "File not found"}, status_code=404)
|
return JSONResponse(content={"error": "File not found"}, status_code=404)
|
||||||
|
|
||||||
async def get_show_data(show: str):
|
def get_latest_season(item):
|
||||||
global cached_data
|
seasons = item.get("SEASONS")
|
||||||
if cached_data is None:
|
if seasons and isinstance(seasons, list):
|
||||||
await dropoutUpdate()
|
try:
|
||||||
|
numeric_seasons = [int(s) for s in seasons if str(s).isdigit()]
|
||||||
for item in cached_data:
|
if numeric_seasons:
|
||||||
if show == item["SHOW"] or show == item["LINK"]:
|
return max(numeric_seasons)
|
||||||
if "SEASONS" not in item:
|
except Exception as e:
|
||||||
item['SEASONS'] = download.grab.season(item['URL'])
|
logging.info(f"Error getting latest season: {e}")
|
||||||
return item
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_latest_season(item):
|
def get_latest_season(item):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user