feat: add upload progress and fix panic

This commit is contained in:
Simon Ding
2024-11-17 21:57:14 +08:00
parent 7d5ce8ba97
commit ba3f6de852
5 changed files with 23 additions and 5 deletions

View File

@@ -207,6 +207,7 @@ func (c *Client) moveCompletedTask(id int) (err1 error) {
if err := stImpl.Copy(filepath.Join(c.db.GetDownloadDir(), torrentName), r.TargetDir); err != nil {
return errors.Wrap(err, "move file")
}
torrent.UploadProgresser = stImpl.UploadProgress
c.db.SetHistoryStatus(r.ID, history.StatusSeeding)
if len(episodeIds) > 0 {
@@ -285,6 +286,7 @@ func (c *Client) CheckDownloadedSeriesFiles(m *ent.Media) error {
type Task struct {
//Processing bool
pkg.Torrent
UploadProgresser func() float64
}
func (c *Client) DownloadSeriesAllEpisodes(id int) []string {