- 修复了未设置订阅站点时无法编辑订阅的问题

- 历史记录支持过滤状态
This commit is contained in:
jxxghp
2023-12-23 19:32:34 +08:00
parent 8f4f4cc004
commit dcf1985361
3 changed files with 37 additions and 13 deletions

View File

@ -42,16 +42,25 @@ def delete_download_history(history_in: schemas.DownloadHistory,
def transfer_history(title: str = None,
page: int = 1,
count: int = 30,
status: bool = None,
db: Session = Depends(get_db),
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
"""
查询转移历史记录
"""
if title == "失败":
title = None
status = False
elif title == "成功":
title = None
status = True
if title:
total = TransferHistory.count_by_title(db, title)
result = TransferHistory.list_by_title(db, title, page, count)
total = TransferHistory.count_by_title(db, title=title, status=status)
result = TransferHistory.list_by_title(db, title=title, page=page,
count=count, status=status)
else:
result = TransferHistory.list_by_page(db, page, count)
result = TransferHistory.list_by_page(db, page=page, count=count, status=status)
total = TransferHistory.count(db)
return schemas.Response(success=True,