Remove doubly hook

This commit is contained in:
Ben Sarmiento
2023-12-07 16:33:04 +01:00
parent 0f6eeaa28d
commit 7d5e5caf6e

View File

@@ -26,16 +26,11 @@ func (t *TorrentManager) repairAll() {
} }
}) })
t.log.Debugf("Found %d torrents to repair", len(toRepair)) t.log.Debugf("Found %d torrents to repair", len(toRepair))
var updatedPaths []string
for i := range toRepair { for i := range toRepair {
torrent := toRepair[i] torrent := toRepair[i]
t.log.Infof("Repairing %s", torrent.AccessKey) t.log.Infof("Repairing %s", torrent.AccessKey)
t.repair(torrent) 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) { 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.log.Infof("Repairing torrent %s", torrent.AccessKey)
t.repair(torrent) t.repair(torrent)
t.log.Infof("Finished repairing torrent %s", torrent.AccessKey) 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)
}) })
} }