diff --git a/app/api/endpoints/system.py b/app/api/endpoints/system.py index e6597a7b..7c9f2dfb 100644 --- a/app/api/endpoints/system.py +++ b/app/api/endpoints/system.py @@ -144,6 +144,7 @@ def fetch_image( def proxy_img( imgurl: str, proxy: bool = False, + cache: bool = False, if_none_match: Annotated[str | None, Header()] = None, _: schemas.TokenPayload = Depends(verify_resource_token) ) -> Response: @@ -154,7 +155,7 @@ def proxy_img( hosts = [config.config.get("host") for config in MediaServerHelper().get_configs().values() if config and config.config and config.config.get("host")] allowed_domains = set(settings.SECURITY_IMAGE_DOMAINS) | set(hosts) - return fetch_image(url=imgurl, proxy=proxy, use_disk_cache=False, + return fetch_image(url=imgurl, proxy=proxy, use_disk_cache=cache, if_none_match=if_none_match, allowed_domains=allowed_domains) diff --git a/app/modules/filemanager/storages/local.py b/app/modules/filemanager/storages/local.py index 8467dbb0..f4078273 100644 --- a/app/modules/filemanager/storages/local.py +++ b/app/modules/filemanager/storages/local.py @@ -191,8 +191,8 @@ class LocalStorage(StorageBase): """ return Path(fileitem.path) - def upload(self, fileitem: schemas.FileItem, path: Path, new_name: Optional[str] = None) -> Optional[ - schemas.FileItem]: + def upload(self, fileitem: schemas.FileItem, path: Path, + new_name: Optional[str] = None) -> Optional[schemas.FileItem]: """ 上传文件 :param fileitem: 上传目录项