Add Speed to callbacks

This commit is contained in:
Mukhtar Akere
2025-02-09 19:17:20 +01:00
parent 186a24cc4a
commit 1614e29f8f
16 changed files with 76 additions and 67 deletions

View File

@@ -38,7 +38,7 @@ func (q *QBit) downloadFiles(torrent *Torrent, parent string) {
debridTorrent.Progress = 0 // Reset progress
debridTorrent.Mu.Unlock()
client := downloaders.GetGrabClient()
progressCallback := func(downloaded int64) {
progressCallback := func(downloaded int64, speed int64) {
debridTorrent.Mu.Lock()
defer debridTorrent.Mu.Unlock()
torrent.Mu.Lock()
@@ -46,6 +46,7 @@ func (q *QBit) downloadFiles(torrent *Torrent, parent string) {
// Update total downloaded bytes
debridTorrent.SizeDownloaded += downloaded
debridTorrent.Speed = speed
// Calculate overall progress
if totalSize > 0 {