feat: add seed ratio display

This commit is contained in:
Simon Ding
2024-08-11 20:41:26 +08:00
parent 5c6ac2c430
commit 5b70badb50
4 changed files with 17 additions and 9 deletions

View File

@@ -49,7 +49,7 @@ func (c *Client) checkTasks() {
torrent := c.tasks[id]
ok := c.isSeedRatioLimitReached(r.IndexerID, torrent)
if ok {
log.Infof("torrent file seed ratio reached, remove: %v", torrent.Name())
log.Infof("torrent file seed ratio reached, remove: %v, current seed ratio: %v", torrent.Name(), torrent.SeedRatio())
torrent.Remove()
delete(c.tasks, id)
} else {
@@ -138,7 +138,7 @@ func (c *Client) moveCompletedTask(id int) (err1 error) {
//判断是否需要删除本地文件
ok := c.isSeedRatioLimitReached(r.IndexerID, torrent)
if downloadclient.RemoveCompletedDownloads && ok {
log.Debugf("download complete,remove torrent and files related")
log.Debugf("download complete,remove torrent and files related, torrent: %v, seed ratio: %v", torrentName, torrent.SeedRatio())
delete(c.tasks, r.ID)
torrent.Remove()
}