fix: task percent

This commit is contained in:
Simon Ding
2025-03-31 17:45:30 +08:00
parent 8cc4e288fe
commit c23666eabf

View File

@@ -135,7 +135,11 @@ func (t *Torrent) Progress() (int, error) {
if t.t.Complete().Bool() {
return 100, nil
}
return int(t.t.BytesCompleted() * 100 / t.TotalSize()), nil
p := int(t.t.BytesCompleted() * 100 / t.TotalSize())
if p >= 100 {
p = 99
}
return 99, nil
}
func (t *Torrent) Stop() error {