feat 定时清理媒体库插件

This commit is contained in:
thsrite
2023-09-28 15:21:01 +08:00
parent ea883255cb
commit 5d04b7abd6
10 changed files with 638 additions and 5 deletions

View File

@ -65,6 +65,10 @@ class TransferHistory(Base):
def get_by_src(db: Session, src: str):
return db.query(TransferHistory).filter(TransferHistory.src == src).first()
@staticmethod
def list_by_hash(db: Session, download_hash: str):
return db.query(TransferHistory).filter(TransferHistory.download_hash == download_hash).all()
@staticmethod
def statistic(db: Session, days: int = 7):
"""