diff --git a/internal/torrent/repair.go b/internal/torrent/repair.go index c70dba6..5669895 100644 --- a/internal/torrent/repair.go +++ b/internal/torrent/repair.go @@ -50,8 +50,14 @@ func (t *TorrentManager) repairAll() { return } }) + if hasBrokenFiles { + t.log.Debugf("Torrent %s has broken files, adding to repair list", t.GetKey(torrent)) + toRepair.Add(torrent) + } - if hasBrokenFiles || torrent.UnassignedLinks.Cardinality() > 0 { + // check 3: for expired links + if torrent.UnassignedLinks.Cardinality() > 0 { + t.log.Debugf("Torrent %s has unassigned links, adding to repair list", t.GetKey(torrent)) toRepair.Add(torrent) } }) diff --git a/internal/torrent/uncached.go b/internal/torrent/uncached.go index c2717ee..f3097a8 100644 --- a/internal/torrent/uncached.go +++ b/internal/torrent/uncached.go @@ -51,6 +51,7 @@ func (t *TorrentManager) getUncachedTorrents() ([]*Torrent, error) { } if _, ok := availabilityChecks[torrent.Hash]; !ok || !availabilityChecks[torrent.Hash] { + t.log.Debugf("Torrent %s is no longer cached, adding to repair list", t.GetKey(torrent)) uncachedTorrents = append(uncachedTorrents, torrent) } }) diff --git a/internal/universal/downloader.go b/internal/universal/downloader.go index e08f438..572166a 100644 --- a/internal/universal/downloader.go +++ b/internal/universal/downloader.go @@ -157,7 +157,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor } if torrent != nil { - log.Debugf("Downloading file %s from torrent %s (%s)%s", file.Path, torrent.Name, unrestrict.Link, rangeLog) + log.Debugf("Downloading file %s from torrent %s (%s)%s", file.Path, torMgr.GetKey(torrent), unrestrict.Link, rangeLog) } else { log.Debugf("Downloading file %s (%s)%s", file.Path, unrestrict.Link, rangeLog) }