Skip to content

Commit

Permalink
fix: progress
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 13, 2024
1 parent 21e027d commit 9b61f0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/transmission/transmission.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion server/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 9b61f0e

Please sign in to comment.