mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
fix: qbit progress
This commit is contained in:
@@ -90,7 +90,7 @@ type TorrentInfo struct {
|
|||||||
NumLeechs int64 `json:"num_leechs"`
|
NumLeechs int64 `json:"num_leechs"`
|
||||||
NumSeeds int64 `json:"num_seeds"`
|
NumSeeds int64 `json:"num_seeds"`
|
||||||
Priority int64 `json:"priority"`
|
Priority int64 `json:"priority"`
|
||||||
Progress int64 `json:"progress"`
|
Progress float64 `json:"progress"`
|
||||||
Ratio float64 `json:"ratio"`
|
Ratio float64 `json:"ratio"`
|
||||||
RatioLimit int64 `json:"ratio_limit"`
|
RatioLimit int64 `json:"ratio_limit"`
|
||||||
SavePath string `json:"save_path"`
|
SavePath string `json:"save_path"`
|
||||||
|
|||||||
@@ -128,7 +128,15 @@ func (t *Torrent) Progress() (int, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
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 {
|
func (t *Torrent) Stop() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user