fix:修复tr下载显示速率问题
This commit is contained in:
parent
9e31c53fa5
commit
aa8cb889f8
@ -122,6 +122,8 @@ class TransmissionModule(_ModuleBase):
|
|||||||
torrents = self.transmission.get_downloading_torrents(tags=settings.TORRENT_TAG)
|
torrents = self.transmission.get_downloading_torrents(tags=settings.TORRENT_TAG)
|
||||||
for torrent in torrents or []:
|
for torrent in torrents or []:
|
||||||
meta = MetaInfo(torrent.name)
|
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(
|
ret_torrents.append(DownloadingTorrent(
|
||||||
hash=torrent.hashString,
|
hash=torrent.hashString,
|
||||||
title=torrent.name,
|
title=torrent.name,
|
||||||
@ -131,8 +133,8 @@ class TransmissionModule(_ModuleBase):
|
|||||||
progress=torrent.progress,
|
progress=torrent.progress,
|
||||||
size=torrent.total_size,
|
size=torrent.total_size,
|
||||||
state="paused" if torrent.status == "stopped" else "downloading",
|
state="paused" if torrent.status == "stopped" else "downloading",
|
||||||
dlspeed=StringUtils.str_filesize(torrent.download_speed),
|
dlspeed=StringUtils.str_filesize(dlspeed),
|
||||||
ulspeed=StringUtils.str_filesize(torrent.upload_speed),
|
upspeed=StringUtils.str_filesize(upspeed),
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user