complete multi-root library path support

This commit is contained in:
ShukeBta
2026-06-26 23:02:07 +08:00
parent 2fbfed3ac9
commit e41105910e
5 changed files with 128 additions and 1 deletions
+13
View File
@@ -335,6 +335,19 @@ func (s *FileManagerService) allowedRoots() (map[string]string, error) {
libs, err := s.repo.Library.List(context.Background())
if err == nil {
for _, l := range libs {
if len(l.Roots) > 0 {
for i, root := range l.Roots {
if !root.Enabled {
continue
}
label := strings.TrimSpace(root.Name)
if label == "" {
label = fmt.Sprintf("路径%d", i+1)
}
add("library:"+l.Name+":"+label, root.Path)
}
continue
}
add("library:"+l.Name, l.Path)
}
}