fix history

This commit is contained in:
jxxghp 2023-07-12 14:53:25 +08:00
parent 880e0c4bd3
commit 0900ab4891
2 changed files with 17 additions and 0 deletions

View File

@ -69,3 +69,18 @@ def delete_transfer_history(history_in: schemas.TransferHistory,
# 删除记录 # 删除记录
TransferHistory.delete(db, history_in.id) TransferHistory.delete(db, history_in.id)
return schemas.Response(success=True) return schemas.Response(success=True)
@router.post("/transfer", summary="历史记录重新转移", response_model=schemas.Response)
def redo_transfer_history(history_in: schemas.TransferHistory,
new_tmdbid: int,
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
"""
历史记录重新转移
"""
hash_str = history_in.download_hash
result = TransferChain().process(f"{hash_str} {new_tmdbid}")
if result:
return schemas.Response(success=True)
else:
return schemas.Response(success=False, message="失败原因详见通知消息")

View File

@ -33,6 +33,8 @@ class TransferChain(ChainBase):
def process(self, arg_str: str = None, userid: Union[str, int] = None) -> bool: def process(self, arg_str: str = None, userid: Union[str, int] = None) -> bool:
""" """
获取下载器中的种子列表并执行转移 获取下载器中的种子列表并执行转移
:param arg_str: 传入的参数 (种子hash和TMDB ID)
:param userid: 用户ID
""" """
def extract_hash_and_number(string: str): def extract_hash_and_number(string: str):