fix 统一处理db事务回滚

This commit is contained in:
jxxghp
2023-09-05 18:19:02 +08:00
parent 51b959cff8
commit b5fc6cdd1e
6 changed files with 24 additions and 16 deletions

View File

@ -47,7 +47,7 @@ class MediaServerItem(Base):
@staticmethod
def empty(db: Session, server: str):
db.query(MediaServerItem).filter(MediaServerItem.server == server).delete()
db.commit()
Base.commit(db)
@staticmethod
def exist_by_tmdbid(db: Session, tmdbid: int, mtype: str):