Remove doubly hook
This commit is contained in:
@@ -26,16 +26,11 @@ func (t *TorrentManager) repairAll() {
|
||||
}
|
||||
})
|
||||
t.log.Debugf("Found %d torrents to repair", len(toRepair))
|
||||
var updatedPaths []string
|
||||
for i := range toRepair {
|
||||
torrent := toRepair[i]
|
||||
t.log.Infof("Repairing %s", torrent.AccessKey)
|
||||
t.repair(torrent)
|
||||
t.assignedDirectoryCb(torrent, func(directory string) {
|
||||
updatedPaths = append(updatedPaths, fmt.Sprintf("%s/%s", directory, torrent.AccessKey))
|
||||
})
|
||||
}
|
||||
t.TriggerHookOnLibraryUpdate(updatedPaths)
|
||||
}
|
||||
|
||||
func (t *TorrentManager) Repair(torrent *Torrent) {
|
||||
@@ -43,12 +38,6 @@ func (t *TorrentManager) Repair(torrent *Torrent) {
|
||||
t.log.Infof("Repairing torrent %s", torrent.AccessKey)
|
||||
t.repair(torrent)
|
||||
t.log.Infof("Finished repairing torrent %s", torrent.AccessKey)
|
||||
|
||||
var updatedPaths []string
|
||||
t.assignedDirectoryCb(torrent, func(directory string) {
|
||||
updatedPaths = append(updatedPaths, fmt.Sprintf("%s/%s", directory, torrent.AccessKey))
|
||||
})
|
||||
t.TriggerHookOnLibraryUpdate(updatedPaths)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user