add 失败历史记录

This commit is contained in:
jxxghp
2023-06-26 12:30:06 +08:00
parent 178ac334a0
commit 66f081de98
3 changed files with 45 additions and 7 deletions

View File

@ -20,5 +20,8 @@ class TransferHistoryOper(DbOper):
"""
新增转移历史
"""
transferhistory = TransferHistory(**kwargs)
return transferhistory.create(self._db)
if kwargs.get("download_hash"):
transferhistory = TransferHistory.get_by_hash(self._db, kwargs.get("download_hash"))
if transferhistory:
transferhistory.delete(self._db, transferhistory.id)
return TransferHistory(**kwargs).create(self._db)