mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
修复下载量为0无法计算分享率导致无法查看我的数据页面的bug
This commit is contained in:
@@ -635,7 +635,7 @@ def site_status_api(request):
|
||||
'sp': sp,
|
||||
'sp_hour': sp_hour,
|
||||
'bonus': bonus,
|
||||
'ratio': round(uploaded / downloaded, 3),
|
||||
'ratio': round(uploaded / downloaded, 3) if downloaded > 0 else float('inf'),
|
||||
'p_years': round(p_years, 4),
|
||||
'now': datetime.strftime(
|
||||
SiteStatus.objects.order_by('-updated_at').first().updated_at,
|
||||
|
||||
Reference in New Issue
Block a user