mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix 删除历史记录文件处理
This commit is contained in:
@@ -90,11 +90,11 @@ def delete_transfer_history(history_in: schemas.TransferHistory,
|
|||||||
if not state:
|
if not state:
|
||||||
return schemas.Response(success=False, msg=f"{dest_fileitem.path}删除失败")
|
return schemas.Response(success=False, msg=f"{dest_fileitem.path}删除失败")
|
||||||
# 删除源文件
|
# 删除源文件
|
||||||
if deletesrc and history.dest_fileitem:
|
if deletesrc and history.src_fileitem:
|
||||||
dest_fileitem = schemas.FileItem(**history.dest_fileitem)
|
src_fileitem = schemas.FileItem(**history.src_fileitem)
|
||||||
state = StorageChain().delete_file(dest_fileitem)
|
state = StorageChain().delete_file(src_fileitem)
|
||||||
if not state:
|
if not state:
|
||||||
return schemas.Response(success=False, msg=f"{dest_fileitem.path}删除失败")
|
return schemas.Response(success=False, msg=f"{src_fileitem.path}删除失败")
|
||||||
# 发送事件
|
# 发送事件
|
||||||
eventmanager.send_event(
|
eventmanager.send_event(
|
||||||
EventType.DownloadFileDeleted,
|
EventType.DownloadFileDeleted,
|
||||||
|
|||||||
Reference in New Issue
Block a user