feat: support reload qbit tasks

This commit is contained in:
Simon Ding
2024-10-04 10:45:31 +08:00
parent 579b010d13
commit 7dfa4eafc4
4 changed files with 50 additions and 25 deletions

View File

@@ -174,3 +174,15 @@ func (t *Torrent) SeedRatio() (float64, error) {
}
return qb.Ratio, nil
}
func (t *Torrent) Reload() error {
c, err := NewClient(t.URL, t.User, t.Password)
if err != nil {
return err
}
t.c = c.c
if !t.Exists() {
return errors.Errorf("torrent not exists: %v", t.Hash)
}
return nil
}