Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(index): support regular expressions for ignored paths #7909

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lanfei
Copy link
Contributor

@Lanfei Lanfei commented Jan 30, 2025

Support regular expressions for index ignored paths.
索引忽略路径支持正则表达式。

@Lanfei
Copy link
Contributor Author

Lanfei commented Jan 30, 2025

Front-end part: AlistGo/alist-web#245

for _, avoidPath := range ignorePaths {
if strings.HasPrefix(indexPath, avoidPath) {
for _, ignoreReg := range ignoreRegs {
if ignoreReg.MatchString(indexPath) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这里最好加个正则标识,以不影响之前的设置。
比如以 re_ 开头才当做正则处理

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原本的评估是改成正则后原来的路径依然在覆盖范围内,只是相同路径的子目录也会被覆盖进去,感觉影响不是太大,所以没做完全兼容。
如果期望100%跟原来一样的话,加一个『使用正则表达式配置忽略路径』的选项呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants