Fixer fix
This commit is contained in:
@@ -22,13 +22,14 @@ func (t *TorrentManager) fixerAddCommand(trigger, command string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *TorrentManager) handleFixers(instances []realdebrid.Torrent) {
|
func (t *TorrentManager) handleFixers(instances []realdebrid.Torrent) {
|
||||||
|
t.log.Debugf("Handling fixers - %d left", t.fixers.Count())
|
||||||
var toDelete []string
|
var toDelete []string
|
||||||
var toRedownload []*Torrent
|
var toRedownload []*Torrent
|
||||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||||
for _, instance := range instances {
|
for _, instance := range instances {
|
||||||
id := instance.ID
|
id := instance.ID
|
||||||
if !t.fixers.Has(id) {
|
if !t.fixers.Has(id) {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
command, _ := t.fixers.Pop(id) // delete the fixer if it's done
|
command, _ := t.fixers.Pop(id) // delete the fixer if it's done
|
||||||
switch command {
|
switch command {
|
||||||
@@ -40,7 +41,7 @@ func (t *TorrentManager) handleFixers(instances []realdebrid.Torrent) {
|
|||||||
toDelete = append(toDelete, id)
|
toDelete = append(toDelete, id)
|
||||||
case "repaired": // this torrent contains broken files
|
case "repaired": // this torrent contains broken files
|
||||||
if instance.Progress != 100 {
|
if instance.Progress != 100 {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
torrent := t.getMoreInfo(instance)
|
torrent := t.getMoreInfo(instance)
|
||||||
t.log.Debugf("Repairing torrent %s again now that fixer id=%s is done", t.GetKey(torrent), id)
|
t.log.Debugf("Repairing torrent %s again now that fixer id=%s is done", t.GetKey(torrent), id)
|
||||||
|
|||||||
Reference in New Issue
Block a user