Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: override min require free space on startup

NTFSvolumec4de67aa760f
diff --git a/cyberdrop_dl/config_definitions/global_settings.py b/cyberdrop_dl/config_definitions/global_settings.py
index a071f22a6..8f95bda35 100644
--- a/cyberdrop_dl/config_definitions/global_settings.py
+++ b/cyberdrop_dl/config_definitions/global_settings.py
@@ -26,7 +26,7 @@ class General(BaseModel):
flaresolverr: HttpURL | None = None
max_file_name_length: PositiveInt = 95
max_folder_name_length: PositiveInt = 60
- required_free_space: ByteSize = Field(DEFAULT_REQUIRED_FREE_SPACE, ge=MIN_REQUIRED_FREE_SPACE)
+ required_free_space: ByteSize = DEFAULT_REQUIRED_FREE_SPACE
@field_serializer("required_free_space")
def human_readable(self, value: ByteSize | int) -> str:
@@ -43,6 +43,11 @@ class General(BaseModel):
def convert_to_str(cls, value: URL | str) -> str | None:
return convert_to_str(value)
+ @field_validator("required_free_space", mode="after")
+ @classmethod
+ def override_min(cls, value: ByteSize) -> ByteSize:
+ return max(value, MIN_REQUIRED_FREE_SPACE)
+
class RateLimitingOptions(BaseModel):
connection_timeout: PositiveInt = 15