1
0
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:
Chris Cummer 2019-07-04 20:17:32 -07:00
parent b5fd3de755
commit 1f82d26ac2

View File

@ -59,6 +59,11 @@ func (widget *Widget) torrentPercentDone(torrent *transmissionrpc.Torrent) strin
func (widget *Widget) torrentSeedRatio(torrent *transmissionrpc.Torrent) string {
seedRatio := *torrent.UploadRatio
if seedRatio < 0 {
seedRatio = 0
}
return fmt.Sprintf("[green]%3d%%↑", int(seedRatio*100))
}