mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-06 18:17:46 +08:00
fix: progress
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user