Add more logging
This commit is contained in:
@@ -54,6 +54,7 @@ func (t *TorrentManager) refreshTorrents() []string {
|
|||||||
t.deleteOnceDone.Remove(fixerID)
|
t.deleteOnceDone.Remove(fixerID)
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
t.log.Debugf("Fixers left: %d", t.fixers.Count())
|
||||||
// ensure delete
|
// ensure delete
|
||||||
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||||
t.deleteOnceDone.Each(func(fixerID string) bool {
|
t.deleteOnceDone.Each(func(fixerID string) bool {
|
||||||
@@ -67,6 +68,7 @@ func (t *TorrentManager) refreshTorrents() []string {
|
|||||||
infoCache.Remove(fixerID)
|
infoCache.Remove(fixerID)
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
t.log.Debugf("Delete once done left: %d", t.deleteOnceDone.Cardinality())
|
||||||
|
|
||||||
newlyFetchedKeys := mapset.NewSet[string]()
|
newlyFetchedKeys := mapset.NewSet[string]()
|
||||||
noInfoCount := 0
|
noInfoCount := 0
|
||||||
@@ -79,6 +81,7 @@ func (t *TorrentManager) refreshTorrents() []string {
|
|||||||
if !info.AnyInProgress() {
|
if !info.AnyInProgress() {
|
||||||
newlyFetchedKeys.Add(accessKey)
|
newlyFetchedKeys.Add(accessKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
if torrent, exists := allTorrents.Get(accessKey); !exists {
|
if torrent, exists := allTorrents.Get(accessKey); !exists {
|
||||||
allTorrents.Set(accessKey, info)
|
allTorrents.Set(accessKey, info)
|
||||||
} else if !info.DownloadedIDs.Difference(torrent.DownloadedIDs).IsEmpty() {
|
} else if !info.DownloadedIDs.Difference(torrent.DownloadedIDs).IsEmpty() {
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ func (t *TorrentManager) repair(torrent *Torrent) {
|
|||||||
} else if info != nil && info.IsDone() && !t.isStillBroken(info, brokenFiles) {
|
} else if info != nil && info.IsDone() && !t.isStillBroken(info, brokenFiles) {
|
||||||
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
|
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
|
||||||
for ix, newFile := range info.Files {
|
for ix, newFile := range info.Files {
|
||||||
if oldFile.ID == newFile.ID {
|
if oldFile.Bytes == newFile.Bytes {
|
||||||
oldFile.Link = info.Links[ix]
|
oldFile.Link = info.Links[ix]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -497,7 +497,7 @@ func (t *TorrentManager) isStillBroken(info *realdebrid.TorrentInfo, brokenFiles
|
|||||||
// check if the broken files can now be unrestricted
|
// check if the broken files can now be unrestricted
|
||||||
for _, oldFile := range brokenFiles {
|
for _, oldFile := range brokenFiles {
|
||||||
for idx, newFile := range selectedFiles {
|
for idx, newFile := range selectedFiles {
|
||||||
if oldFile.Path == newFile.Path || oldFile.Bytes == newFile.Bytes {
|
if oldFile.Bytes == newFile.Bytes {
|
||||||
unrestrict := t.UnrestrictUntilOk(selectedFiles[idx].Link)
|
unrestrict := t.UnrestrictUntilOk(selectedFiles[idx].Link)
|
||||||
if unrestrict == nil || oldFile.Bytes != unrestrict.Filesize {
|
if unrestrict == nil || oldFile.Bytes != unrestrict.Filesize {
|
||||||
return true
|
return true
|
||||||
@@ -529,7 +529,7 @@ func (t *TorrentManager) handleFixers(fixer realdebrid.Torrent) *Torrent {
|
|||||||
if !t.isStillBroken(info, brokenFiles) {
|
if !t.isStillBroken(info, brokenFiles) {
|
||||||
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
|
torrent.SelectedFiles.IterCb(func(_ string, oldFile *File) {
|
||||||
for ix, newFile := range info.Files {
|
for ix, newFile := range info.Files {
|
||||||
if oldFile.ID == newFile.ID {
|
if oldFile.Bytes == newFile.Bytes {
|
||||||
oldFile.Link = info.Links[ix]
|
oldFile.Link = info.Links[ix]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user