From aa8cb889f857ce49ea6f18a8a134fd4911c83d76 Mon Sep 17 00:00:00 2001 From: olly Date: Sun, 27 Aug 2023 18:22:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dtr=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=9F=E7=8E=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/transmission/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/modules/transmission/__init__.py b/app/modules/transmission/__init__.py index b4f5845b..013efd79 100644 --- a/app/modules/transmission/__init__.py +++ b/app/modules/transmission/__init__.py @@ -122,6 +122,8 @@ class TransmissionModule(_ModuleBase): torrents = self.transmission.get_downloading_torrents(tags=settings.TORRENT_TAG) for torrent in torrents or []: meta = MetaInfo(torrent.name) + dlspeed = torrent.rate_download if hasattr(torrent, "rate_download") else torrent.rateDownload + upspeed = torrent.rate_upload if hasattr(torrent, "rate_upload") else torrent.rateUpload ret_torrents.append(DownloadingTorrent( hash=torrent.hashString, title=torrent.name, @@ -131,8 +133,8 @@ class TransmissionModule(_ModuleBase): progress=torrent.progress, size=torrent.total_size, state="paused" if torrent.status == "stopped" else "downloading", - dlspeed=StringUtils.str_filesize(torrent.download_speed), - ulspeed=StringUtils.str_filesize(torrent.upload_speed), + dlspeed=StringUtils.str_filesize(dlspeed), + upspeed=StringUtils.str_filesize(upspeed), )) else: return None