fix: return last record when get downloadhistory by hash

This commit is contained in:
yxlimo
2024-12-02 22:55:57 +08:00
parent 71f170a1ad
commit f0ecc1a497

View File

@@ -53,7 +53,7 @@ class DownloadHistory(Base):
@staticmethod
@db_query
def get_by_hash(db: Session, download_hash: str):
return db.query(DownloadHistory).filter(DownloadHistory.download_hash == download_hash).first()
return db.query(DownloadHistory).filter(DownloadHistory.download_hash == download_hash).last()
@staticmethod
@db_query