Add logs for what is added on repair list

This commit is contained in:
Ben Sarmiento
2024-01-24 06:23:39 +01:00
parent 93f57de234
commit 2b6f0f95a8
3 changed files with 9 additions and 2 deletions

View File

@@ -50,8 +50,14 @@ func (t *TorrentManager) repairAll() {
return 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) toRepair.Add(torrent)
} }
}) })

View File

@@ -51,6 +51,7 @@ func (t *TorrentManager) getUncachedTorrents() ([]*Torrent, error) {
} }
if _, ok := availabilityChecks[torrent.Hash]; !ok || !availabilityChecks[torrent.Hash] { 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) uncachedTorrents = append(uncachedTorrents, torrent)
} }
}) })

View File

@@ -157,7 +157,7 @@ func (dl *Downloader) streamFileToResponse(torrent *intTor.Torrent, file *intTor
} }
if torrent != nil { 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 { } else {
log.Debugf("Downloading file %s (%s)%s", file.Path, unrestrict.Link, rangeLog) log.Debugf("Downloading file %s (%s)%s", file.Path, unrestrict.Link, rangeLog)
} }