任务状态调整为前端过滤

This commit is contained in:
ngfchl
2022-09-28 09:24:40 +08:00
parent aa951cf153
commit fc2dcdb4e3
2 changed files with 64 additions and 20 deletions

View File

@@ -141,7 +141,7 @@ def get_downloading(request):
'day,', ''
).replace(':', '小时', 1).replace(':', '', 1).split('.')[0] + ''
# 大小与速度处理
torrent['state'] = TorrentBaseInfo.download_state.get(torrent.get('state'))
# torrent['state'] = TorrentBaseInfo.download_state.get(torrent.get('state'))
torrent['ratio'] = '%.4f' % torrent.get('ratio') if torrent['ratio'] >= 0.0001 else 0
torrent['progress'] = '%.4f' % torrent.get('progress') if float(torrent['progress']) < 1 else 1
torrent['uploaded'] = '' if torrent['uploaded'] == 0 else torrent['uploaded']