mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-08 06:16:37 +08:00
complete multi-root library path support
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user