mirror of https://github.com/Xhofe/alist
fix(index): fix the issue where ignored paths are not updated (#7907)
parent
d983a4ebcb
commit
0219c4e15a
|
@ -38,7 +38,7 @@ func WriteProgress(progress *model.IndexProgress) {
|
|||
}
|
||||
}
|
||||
|
||||
func updateIgnorePaths() {
|
||||
func updateIgnorePaths(customIgnorePaths string) {
|
||||
storages := op.GetAllStorages()
|
||||
ignorePaths := make([]string, 0)
|
||||
var skipDrivers = []string{"AList V2", "AList V3", "Virtual"}
|
||||
|
@ -66,7 +66,6 @@ func updateIgnorePaths() {
|
|||
}
|
||||
}
|
||||
}
|
||||
customIgnorePaths := setting.GetStr(conf.IgnorePaths)
|
||||
if customIgnorePaths != "" {
|
||||
ignorePaths = append(ignorePaths, strings.Split(customIgnorePaths, "\n")...)
|
||||
}
|
||||
|
@ -84,13 +83,13 @@ func isIgnorePath(path string) bool {
|
|||
|
||||
func init() {
|
||||
op.RegisterSettingItemHook(conf.IgnorePaths, func(item *model.SettingItem) error {
|
||||
updateIgnorePaths()
|
||||
updateIgnorePaths(item.Value)
|
||||
return nil
|
||||
})
|
||||
op.RegisterStorageHook(func(typ string, storage driver.Driver) {
|
||||
var skipDrivers = []string{"AList V2", "AList V3", "Virtual"}
|
||||
if utils.SliceContains(skipDrivers, storage.Config().Name) {
|
||||
updateIgnorePaths()
|
||||
updateIgnorePaths(setting.GetStr(conf.IgnorePaths))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue