Prevent double repairs

This commit is contained in:
Ben Sarmiento
2023-12-10 22:57:46 +01:00
parent ff72265bfb
commit 74b6ddc99c
4 changed files with 16 additions and 7 deletions

View File

@@ -12,7 +12,9 @@ func (t *TorrentManager) CheckDeletedStatus(torrent *Torrent) bool {
if len(unselectedIDs) == torrent.SelectedFiles.Count() && len(unselectedIDs) > 0 {
return true
} else if len(unselectedIDs) > 0 {
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
torrent.DownloadedIDs.Each(func(id string) bool {
infoCache.Set(id, torrent)
t.writeTorrentToFile(id, torrent)
return true
})