mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix DownloadHistory.get_by_mediaid
This commit is contained in:
@@ -65,8 +65,11 @@ class DownloadHistory(Base):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@db_query
|
@db_query
|
||||||
def get_by_mediaid(db: Session, tmdbid: int, doubanid: str):
|
def get_by_mediaid(db: Session, tmdbid: int, doubanid: str):
|
||||||
return db.query(DownloadHistory).filter(or_(DownloadHistory.tmdbid == tmdbid,
|
if tmdbid:
|
||||||
DownloadHistory.doubanid == doubanid)).all()
|
return db.query(DownloadHistory).filter(DownloadHistory.tmdbid == tmdbid).all()
|
||||||
|
elif doubanid:
|
||||||
|
return db.query(DownloadHistory).filter(DownloadHistory.doubanid == doubanid).all()
|
||||||
|
return []
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@db_query
|
@db_query
|
||||||
|
|||||||
Reference in New Issue
Block a user