fix(api): keep src/dest fileitem fields in transfer history response

TransferHistory schema omitted src_fileitem, dest_fileitem and files which
are emitted by to_dict, so the response_model filter stripped the file
size the frontend reads from src_fileitem.size.
This commit is contained in:
jxxghp
2026-08-14 20:40:02 +08:00
parent b3509c60bb
commit c580181049
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -73,6 +73,10 @@ class TransferHistory(OptionalMediaIdentityMixin, BaseModel):
src_storage: Optional[str] = None
# 目标存储类型
dest_storage: Optional[str] = None
# 源文件项(含文件大小等运行时字段,与 to_dict 直出保持一致)
src_fileitem: Optional[JsonData] = None
# 目标文件项
dest_fileitem: Optional[JsonData] = None
# 源目录
src: Optional[str] = None
# 目的目录
@@ -121,6 +125,8 @@ class TransferHistory(OptionalMediaIdentityMixin, BaseModel):
errmsg: Optional[str] = None
# 日期
date: Optional[str] = None
# 文件清单
files: Optional[JsonData] = None
model_config = ConfigDict(from_attributes=True)