Skip to content

Commit

Permalink
Merge pull request #2944 from wikrin/fix-message
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Oct 26, 2024
2 parents 2af2176 + 646349a commit 00be46b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/api/endpoints/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/api/endpoints/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 00be46b

Please sign in to comment.