fix:修复-比特率为负数时,限速失败的情况

This commit is contained in:
Doubly
2024-10-26 21:35:22 +08:00
parent 3a71a046bc
commit dd7a9955eb

View File

@@ -539,7 +539,8 @@ class SpeedLimiter(_PluginBase):
"""
计算智能上传限速
"""
if not self._bandwidth:
# 当前总比特率大于总带宽,则设置为最低限速
if not self._bandwidth or total_bit_rate > self._bandwidth:
return 10
return round((self._bandwidth - total_bit_rate) / 8 / 1024, 2)