feat(task): add speed monitor (#7655)

This commit is contained in:
KirCute_ECT
2024-12-25 21:09:54 +08:00
committed by GitHub
parent db99224126
commit d7aa1608ac
18 changed files with 116 additions and 44 deletions

View File

@ -64,6 +64,7 @@ func (a *QBittorrent) Status(task *tool.DownloadTask) (*tool.Status, error) {
return nil, err
}
s := &tool.Status{}
s.TotalBytes = info.Size
s.Progress = float64(info.Completed) / float64(info.Size) * 100
switch info.State {
case qbittorrent.UPLOADING, qbittorrent.PAUSEDUP, qbittorrent.QUEUEDUP, qbittorrent.STALLEDUP, qbittorrent.FORCEDUP, qbittorrent.CHECKINGUP: