-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When just opening a file, usually we don't care too much about all the validity checks, that's mostly for us when we're checking if something's wrong. the validations end up taking a long freaking time for very large torrents because there are several big iterations in there, so we should
- change the general behavior of instantiating the
Torrentmodel to exclude all but the necessary validations - make a decorator for the validators that allows us to declare some validation types/scopes/profiles and etc, like
@field_validator("whatever", mode="after")
@validation_scope("pieces", "something-else")
def some_validation_function(...): ...So that we can then use the context like
Torrent.model_validate(data, context={"tm_validation": ["pieces"]})
# or
Torrent.model_validate(data, context={"tm_validation": ["all"]})- make a
torrent_validatemethod that is a shortcut to that - accept validation modes in
read()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels