mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Add multi episodes/seasons safeguards
This commit is contained in:
parent
f90d2d2f04
commit
9dde2475fc
@ -7,7 +7,7 @@ import re
|
||||
from aiohttp import ClientSession
|
||||
from pathlib import Path
|
||||
from typing import List, Literal, Any
|
||||
from providers.provider import Provider
|
||||
from providers.provider import Provider, ProviderError
|
||||
from providers.types.collection import Collection
|
||||
from providers.types.show import Show
|
||||
from providers.types.episode import Episode, PartialShow
|
||||
@ -88,6 +88,11 @@ class Scanner:
|
||||
if raw.get("season") == raw.get("year") and "season" in raw:
|
||||
del raw["season"]
|
||||
|
||||
if isinstance(raw.get("season"), List):
|
||||
raise ProviderError(f"An episode can't have multiple seasons (found {raw.get("season")} for {path})")
|
||||
if isinstance(raw.get("episode"), List):
|
||||
raise ProviderError(f"Multi-episodes files are not yet supported (for {path})")
|
||||
|
||||
logging.info("Identied %s: %s", path, raw)
|
||||
|
||||
if raw["type"] == "movie":
|
||||
|
Loading…
x
Reference in New Issue
Block a user