Merge pull request #2944 from wikrin/fix-message

This commit is contained in:
jxxghp
2024-10-26 08:10:00 +08:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -82,20 +82,20 @@ def delete_transfer_history(history_in: schemas.TransferHistory,
"""
history: TransferHistory = TransferHistory.get(db, history_in.id)
if not history:
return schemas.Response(success=False, msg="记录不存在")
return schemas.Response(success=False, message="记录不存在")
# 册除媒体库文件
if deletedest and history.dest_fileitem:
dest_fileitem = schemas.FileItem(**history.dest_fileitem)
state = StorageChain().delete_media_file(fileitem=dest_fileitem, mtype=MediaType(history.type))
if not state:
return schemas.Response(success=False, msg=f"{dest_fileitem.path} 删除失败")
return schemas.Response(success=False, message=f"{dest_fileitem.path} 删除失败")
# 删除源文件
if deletesrc and history.src_fileitem:
src_fileitem = schemas.FileItem(**history.src_fileitem)
state = StorageChain().delete_media_file(src_fileitem)
if not state:
return schemas.Response(success=False, msg=f"{src_fileitem.path} 删除失败")
return schemas.Response(success=False, message=f"{src_fileitem.path} 删除失败")
# 发送事件
eventmanager.send_event(
EventType.DownloadFileDeleted,

View File

@@ -98,7 +98,7 @@ def manual_transfer(transer_item: ManualTransferItem,
dest_fileitem = FileItem(**history.dest_fileitem)
state = StorageChain().delete_media_file(dest_fileitem, mtype=MediaType(history.type))
if not state:
return schemas.Response(success=False, msg=f"{dest_fileitem.path} 删除失败")
return schemas.Response(success=False, message=f"{dest_fileitem.path} 删除失败")
# 从历史数据获取信息
if transer_item.from_history: