修复下载量为0无法计算分享率导致无法查看我的数据页面的bug

This commit is contained in:
ngfchl
2022-12-30 11:16:47 +08:00
parent 1ac8823ecf
commit 5bc5952ba1

View File

@@ -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,