fix history
This commit is contained in:
parent
880e0c4bd3
commit
0900ab4891
@ -69,3 +69,18 @@ def delete_transfer_history(history_in: schemas.TransferHistory,
|
||||
# 删除记录
|
||||
TransferHistory.delete(db, history_in.id)
|
||||
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="失败原因详见通知消息")
|
||||
|
@ -33,6 +33,8 @@ class TransferChain(ChainBase):
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user