Hotfixes:

- Fix % error in url encode
- FIx alldebrid downloading bug
- Fix dupicate checks for newly added torrents
This commit is contained in:
Mukhtar Akere
2025-04-20 00:44:58 +01:00
parent dc8ee3d150
commit a27c5dd491
11 changed files with 137 additions and 92 deletions
+6 -5
View File
@@ -181,8 +181,7 @@ func (q *QBit) UpdateTorrentMin(t *Torrent, debridTorrent *debrid.Torrent) *Torr
addedOn = time.Now()
}
totalSize := debridTorrent.Bytes
progress := cmp.Or(debridTorrent.Progress, 0.0)
progress = progress / 100.0
progress := (cmp.Or(debridTorrent.Progress, 0.0)) / 100.0
sizeCompleted := int64(float64(totalSize) * progress)
var speed int64
@@ -218,9 +217,11 @@ func (q *QBit) UpdateTorrent(t *Torrent, debridTorrent *debrid.Torrent) *Torrent
if debridTorrent == nil {
return t
}
_db := service.GetDebrid().GetClient(debridTorrent.Debrid)
if debridTorrent.Status != "downloaded" {
_ = _db.UpdateTorrent(debridTorrent)
if debridClient := service.GetDebrid().GetClient(debridTorrent.Debrid); debridClient != nil {
if debridTorrent.Status != "downloaded" {
_ = debridClient.UpdateTorrent(debridTorrent)
}
}
t = q.UpdateTorrentMin(t, debridTorrent)
t.ContentPath = t.TorrentPath + string(os.PathSeparator)
+1 -1
View File
@@ -228,7 +228,7 @@ type Torrent struct {
}
func (t *Torrent) IsReady() bool {
return t.AmountLeft <= 0 && t.TorrentPath != ""
return (t.AmountLeft <= 0 || t.Progress == 1) && t.TorrentPath != ""
}
func (t *Torrent) discordContext() string {