Rigorous fix check
This commit is contained in:
@@ -63,6 +63,7 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
|||||||
t.log.Debugf("Ensuring that torrent id=%s is deleted", fixerID)
|
t.log.Debugf("Ensuring that torrent id=%s is deleted", fixerID)
|
||||||
t.Delete(t.GetKey(torrent), true)
|
t.Delete(t.GetKey(torrent), true)
|
||||||
t.Api.DeleteTorrent(fixerID)
|
t.Api.DeleteTorrent(fixerID)
|
||||||
|
infoCache.Remove(fixerID)
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func (t *TorrentManager) repairAll() {
|
|||||||
toRepair := mapset.NewSet[*Torrent]()
|
toRepair := mapset.NewSet[*Torrent]()
|
||||||
|
|
||||||
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
||||||
if torrent.AnyInProgress() || torrent.UnrepairableReason != "" {
|
if torrent.AnyInProgress() || torrent.AllInProgress() || torrent.UnrepairableReason != "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ func (t *TorrentManager) Repair(torrent *Torrent) {
|
|||||||
t.log.Warnf("Torrent %s is already being repaired, skipping repair", t.GetKey(torrent))
|
t.log.Warnf("Torrent %s is already being repaired, skipping repair", t.GetKey(torrent))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if torrent.AnyInProgress() {
|
if torrent.AnyInProgress() || torrent.AllInProgress() {
|
||||||
t.log.Infof("Torrent %s is in progress, skipping repair until download is done", t.GetKey(torrent))
|
t.log.Infof("Torrent %s is in progress, skipping repair until download is done", t.GetKey(torrent))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -344,9 +344,12 @@ func (t *TorrentManager) redownloadTorrent(torrent *Torrent, selection string) (
|
|||||||
|
|
||||||
if len(oldTorrentIDs) > 0 {
|
if len(oldTorrentIDs) > 0 {
|
||||||
// replace the old torrent
|
// replace the old torrent
|
||||||
|
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
|
||||||
for _, id := range oldTorrentIDs {
|
for _, id := range oldTorrentIDs {
|
||||||
|
torrent.DownloadedIDs.Remove(id)
|
||||||
t.Api.DeleteTorrent(id)
|
t.Api.DeleteTorrent(id)
|
||||||
t.deleteOnceDone.Add(id)
|
t.deleteOnceDone.Add(id)
|
||||||
|
infoCache.Remove(id)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// it's a fixer
|
// it's a fixer
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func (t *TorrentManager) getUncachedTorrents() ([]*Torrent, error) {
|
|||||||
hashGroups = append(hashGroups, currentGroup)
|
hashGroups = append(hashGroups, currentGroup)
|
||||||
|
|
||||||
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
||||||
if torrent.AnyInProgress() || torrent.UnrepairableReason != "" {
|
if torrent.AnyInProgress() || torrent.AllInProgress() || torrent.UnrepairableReason != "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ func (t *TorrentManager) getUncachedTorrents() ([]*Torrent, error) {
|
|||||||
|
|
||||||
var uncachedTorrents []*Torrent
|
var uncachedTorrents []*Torrent
|
||||||
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
allTorrents.IterCb(func(_ string, torrent *Torrent) {
|
||||||
if torrent.AnyInProgress() || torrent.UnrepairableReason != "" {
|
if torrent.AnyInProgress() || torrent.AllInProgress() || torrent.UnrepairableReason != "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user