mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Fix a Transmission bug in which seed ratios could be negative percentages
This commit is contained in:
parent
b5fd3de755
commit
1f82d26ac2
@ -59,6 +59,11 @@ func (widget *Widget) torrentPercentDone(torrent *transmissionrpc.Torrent) strin
|
|||||||
|
|
||||||
func (widget *Widget) torrentSeedRatio(torrent *transmissionrpc.Torrent) string {
|
func (widget *Widget) torrentSeedRatio(torrent *transmissionrpc.Torrent) string {
|
||||||
seedRatio := *torrent.UploadRatio
|
seedRatio := *torrent.UploadRatio
|
||||||
|
|
||||||
|
if seedRatio < 0 {
|
||||||
|
seedRatio = 0
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("[green]%3d%%↑", int(seedRatio*100))
|
return fmt.Sprintf("[green]%3d%%↑", int(seedRatio*100))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user