fix: progress

This commit is contained in:
Simon Ding
2024-07-13 09:26:05 +08:00
parent 21e027d620
commit 9b61f0e76a
2 changed files with 7 additions and 3 deletions

View File

@@ -92,8 +92,12 @@ func (t *Torrent) Progress() int {
if t.getTorrent().IsFinished != nil && *t.getTorrent().IsFinished {
return 100
}
if t.getTorrent().PercentDone != nil {
p := int(*t.getTorrent().PercentDone * 100)
if t.getTorrent().PercentComplete != nil && *t.getTorrent().PercentComplete >= 1 {
return 100
}
if t.getTorrent().PercentComplete != nil {
p := int(*t.getTorrent().PercentComplete * 100)
if p == 100 {
p = 99
}

View File

@@ -133,7 +133,7 @@ func (s *Server) searchAndDownload(seriesId, seasonNum, episodeNum int) (*string
}
s.tasks[history.ID] = torrent
log.Errorf("success add %s to download task", r1.Name)
log.Infof("success add %s to download task", r1.Name)
return &r1.Name, nil
}