feat 下载中信息增加用户

This commit is contained in:
jxxghp 2023-10-16 08:28:54 +08:00
parent f5de48ca30
commit 40a77b438e
2 changed files with 5 additions and 0 deletions

View File

@ -786,6 +786,7 @@ class DownloadChain(ChainBase):
for torrent in torrents:
history = self.downloadhis.get_by_hash(torrent.hash)
if history:
# 媒体信息
torrent.media = {
"tmdbid": history.tmdbid,
"type": history.type,
@ -794,6 +795,8 @@ class DownloadChain(ChainBase):
"episode": history.episodes,
"image": history.image,
}
# 下载用户
torrent.userid = history.userid
ret_torrents.append(torrent)
return ret_torrents

View File

@ -12,6 +12,7 @@ class TransferTorrent(BaseModel):
path: Optional[Path] = None
hash: Optional[str] = None
tags: Optional[str] = None
userid: Optional[str] = None
class DownloadingTorrent(BaseModel):
@ -29,6 +30,7 @@ class DownloadingTorrent(BaseModel):
upspeed: Optional[str] = None
dlspeed: Optional[str] = None
media: Optional[dict] = {}
userid: Optional[str] = None
class TransferInfo(BaseModel):