mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-08 03:27:27 +08:00
feat: implement seed ratio check logic
This commit is contained in:
@@ -130,6 +130,9 @@ func (t *Torrent) Exists() bool {
|
||||
}
|
||||
|
||||
func (t *Torrent) Name() string {
|
||||
if !t.Exists() {
|
||||
return ""
|
||||
}
|
||||
return *t.getTorrent().Name
|
||||
}
|
||||
|
||||
@@ -155,6 +158,10 @@ func (t *Torrent) Stop() error {
|
||||
return t.c.TorrentStopIDs(context.TODO(), []int64{t.ID})
|
||||
}
|
||||
|
||||
func (t *Torrent) SeedRatio() *float64 {
|
||||
return t.getTorrent().UploadRatio
|
||||
}
|
||||
|
||||
func (t *Torrent) Start() error {
|
||||
return t.c.TorrentStartIDs(context.TODO(), []int64{t.ID})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user