feat: download - download dwnload limieten in settings
This commit is contained in:
Binary file not shown.
@@ -103,12 +103,21 @@ class FileInfoResponse(BaseModel):
|
||||
height: int | None = None
|
||||
|
||||
|
||||
class ZipDownloadLimitsResponse(BaseModel):
|
||||
max_items: int
|
||||
max_total_input_bytes: int
|
||||
max_individual_file_bytes: int
|
||||
scan_timeout_seconds: float
|
||||
symlink_policy: str
|
||||
|
||||
|
||||
class SettingsResponse(BaseModel):
|
||||
show_thumbnails: bool
|
||||
preferred_startup_path_left: str | None = None
|
||||
preferred_startup_path_right: str | None = None
|
||||
selected_theme: str
|
||||
selected_color_mode: str
|
||||
zip_download_limits: ZipDownloadLimitsResponse
|
||||
|
||||
|
||||
class SettingsUpdateRequest(BaseModel):
|
||||
|
||||
Binary file not shown.
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from backend.app.api.errors import AppError
|
||||
from backend.app.api.schemas import SettingsResponse, SettingsUpdateRequest
|
||||
from backend.app.api.schemas import SettingsResponse, SettingsUpdateRequest, ZipDownloadLimitsResponse
|
||||
from backend.app.db.settings_repository import SettingsRepository
|
||||
from backend.app.security.path_guard import PathGuard
|
||||
from backend.app.services.file_ops_service import ZIP_DOWNLOAD_PREFLIGHT_LIMITS
|
||||
|
||||
|
||||
VALID_THEMES = {
|
||||
@@ -38,6 +39,13 @@ class SettingsService:
|
||||
preferred_startup_path_right=preferred_right,
|
||||
selected_theme=selected_theme,
|
||||
selected_color_mode=selected_color_mode,
|
||||
zip_download_limits=ZipDownloadLimitsResponse(
|
||||
max_items=ZIP_DOWNLOAD_PREFLIGHT_LIMITS.max_items,
|
||||
max_total_input_bytes=ZIP_DOWNLOAD_PREFLIGHT_LIMITS.max_total_input_bytes,
|
||||
max_individual_file_bytes=ZIP_DOWNLOAD_PREFLIGHT_LIMITS.max_individual_file_bytes,
|
||||
scan_timeout_seconds=ZIP_DOWNLOAD_PREFLIGHT_LIMITS.scan_timeout_seconds,
|
||||
symlink_policy="not_allowed",
|
||||
),
|
||||
)
|
||||
|
||||
def update_settings(self, request: SettingsUpdateRequest) -> SettingsResponse:
|
||||
|
||||
Reference in New Issue
Block a user