mirror of
https://github.com/tropicoo/yt-dlp-bot.git
synced 2024-09-20 06:46:08 +08:00
Update
This commit is contained in:
parent
27319fdf0f
commit
42f5594125
|
@ -30,7 +30,7 @@ class BaseUploadContext(RealBaseModel):
|
||||||
model_config = ConfigDict(**RealBaseModel.model_config, strict=True)
|
model_config = ConfigDict(**RealBaseModel.model_config, strict=True)
|
||||||
caption: str
|
caption: str
|
||||||
filename: str
|
filename: str
|
||||||
filepath: FilePath
|
filepath: FilePath | str
|
||||||
duration: float
|
duration: float
|
||||||
type: MessageMediaType
|
type: MessageMediaType
|
||||||
is_cached: bool = False
|
is_cached: bool = False
|
||||||
|
@ -39,7 +39,7 @@ class BaseUploadContext(RealBaseModel):
|
||||||
class VideoUploadContext(BaseUploadContext):
|
class VideoUploadContext(BaseUploadContext):
|
||||||
height: int | float
|
height: int | float
|
||||||
width: int | float
|
width: int | float
|
||||||
thumb: FilePath | None = None
|
thumb: FilePath | str | None = None
|
||||||
|
|
||||||
|
|
||||||
class AudioUploadContext(BaseUploadContext):
|
class AudioUploadContext(BaseUploadContext):
|
||||||
|
|
|
@ -32,7 +32,9 @@ except ImportError:
|
||||||
|
|
||||||
class BaseHostConfModel(BaseModel):
|
class BaseHostConfModel(BaseModel):
|
||||||
# TODO: Add validators.
|
# TODO: Add validators.
|
||||||
model_config = ConfigDict(strict=True, frozen=True, validate_assignment=True)
|
model_config = ConfigDict(
|
||||||
|
strict=True, frozen=True, validate_assignment=True, validate_default=True
|
||||||
|
)
|
||||||
|
|
||||||
hostnames: tuple[str, ...]
|
hostnames: tuple[str, ...]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,9 @@ from yt_shared.enums import RabbitPayloadType
|
||||||
class RealBaseModel(BaseModel, ABC):
|
class RealBaseModel(BaseModel, ABC):
|
||||||
"""Base Pydantic model. All non-strict models should inherit from it."""
|
"""Base Pydantic model. All non-strict models should inherit from it."""
|
||||||
|
|
||||||
model_config = ConfigDict(extra='forbid', validate_default=True)
|
model_config = ConfigDict(
|
||||||
|
extra='forbid', validate_default=True, validate_assignment=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class StrictRealBaseModel(RealBaseModel, ABC):
|
class StrictRealBaseModel(RealBaseModel, ABC):
|
||||||
|
|
Loading…
Reference in a new issue