Add library update hook on repair all
This commit is contained in:
@@ -31,7 +31,7 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
||||
}
|
||||
wg.Wait()
|
||||
close(infoChan)
|
||||
t.log.Infof("Fetched info for %d torrents", len(instances))
|
||||
t.log.Debugf("Fetched info for %d torrents", len(instances))
|
||||
|
||||
freshKeys := set.NewStringSet()
|
||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||
@@ -55,6 +55,7 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
||||
strset.Difference(freshKeys, t.allAccessKeys).Each(func(accessKey string) bool {
|
||||
// assign to directories
|
||||
tor, _ := allTorrents.Get(accessKey)
|
||||
var directories []string
|
||||
t.assignedDirectoryCb(tor, func(directory string) {
|
||||
if strings.HasPrefix(directory, "int__") {
|
||||
return
|
||||
@@ -62,8 +63,11 @@ func (t *TorrentManager) RefreshTorrents() []string {
|
||||
torrents, _ := t.DirectoryMap.Get(directory)
|
||||
torrents.Set(accessKey, tor)
|
||||
updatedPaths = append(updatedPaths, fmt.Sprintf("%s/%s", directory, accessKey))
|
||||
if directory != "__all__" {
|
||||
directories = append(directories, directory)
|
||||
}
|
||||
})
|
||||
t.log.Infof("Added %s to the library", accessKey)
|
||||
t.log.Debugf("Added %s to %v", accessKey, directories)
|
||||
t.allAccessKeys.Add(accessKey)
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user