From 40a77b438e70c27715e3fa2fef540c03c5bf955c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 16 Oct 2023 08:28:54 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=B8=8B=E8=BD=BD=E4=B8=AD=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 3 +++ app/schemas/transfer.py | 2 ++ 2 files changed, 5 insertions(+) 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):