fix: qbit progress

This commit is contained in:
Simon Ding
2024-10-04 11:36:12 +08:00
parent 3af5f96cb0
commit 7461918a6c
2 changed files with 27 additions and 19 deletions

View File

@@ -128,7 +128,15 @@ func (t *Torrent) Progress() (int, error) {
if err != nil {
return 0, err
}
return int(qb.Progress), nil
p := qb.Progress * 100
if p >= 100 {
return 100, nil
}
if int(p) == 100 {
return 99, nil
}
return int(p), nil
}
func (t *Torrent) Stop() error {