feat 下载器种子同步插件

This commit is contained in:
thsrite
2023-08-31 14:33:39 +08:00
parent cb41086fa3
commit 8739a67679
3 changed files with 373 additions and 0 deletions

View File

@ -114,3 +114,11 @@ class TransferHistory(Base):
TransferHistory.year == year,
TransferHistory.seasons == season,
TransferHistory.episodes == episode).all()
@staticmethod
def update_download_hash(db: Session, historyid: int = None, download_hash: str = None):
db.query(TransferHistory).filter(TransferHistory.id == historyid).update(
{
"download_hash": download_hash
}
)

View File

@ -79,3 +79,9 @@ class TransferHistoryOper(DbOper):
if transferhistory:
transferhistory.delete(self._db, transferhistory.id)
return TransferHistory(**kwargs).create(self._db)
def update_download_hash(self, historyid, download_hash):
"""
补充转移记录download_hash
"""
TransferHistory.update_download_hash(self._db, historyid, download_hash)