add subscribe/files api

This commit is contained in:
jxxghp
2024-09-08 13:02:42 +08:00
parent 01505ceaa7
commit 34ae663d5a
13 changed files with 241 additions and 38 deletions

View File

@@ -53,6 +53,12 @@ class DownloadHistory(Base):
def get_by_hash(db: Session, download_hash: str):
return db.query(DownloadHistory).filter(DownloadHistory.download_hash == download_hash).first()
@staticmethod
@db_query
def get_by_mediaid(db: Session, tmdbid: int, doubanid: str):
return db.query(DownloadHistory).filter(DownloadHistory.tmdbid == tmdbid,
DownloadHistory.doubanid == doubanid).all()
@staticmethod
@db_query
def list_by_page(db: Session, page: int = 1, count: int = 30):