mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-25 03:57:47 +08:00
feat: support reload qbit tasks
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user