diff --git a/app/chain/download.py b/app/chain/download.py index 739b5ec6..036b2466 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -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 diff --git a/app/schemas/transfer.py b/app/schemas/transfer.py index 55f57844..588f245f 100644 --- a/app/schemas/transfer.py +++ b/app/schemas/transfer.py @@ -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):