🎇 多盘支持

This commit is contained in:
微凉
2021-03-16 21:25:16 +08:00
parent 8e9ddcf81e
commit 4d0d892ce7
19 changed files with 177 additions and 173 deletions

22
utils/config.go Normal file
View File

@ -0,0 +1,22 @@
package utils
import "github.com/Xhofe/alist/conf"
func GetDriveByName(name string) *conf.Drive {
for i, drive := range conf.Conf.AliDrive.Drives{
if drive.Name == name {
return &conf.Conf.AliDrive.Drives[i]
}
}
return nil
}
func GetNames() []string {
res := make([]string, 0)
for _, drive := range conf.Conf.AliDrive.Drives{
if !drive.Hide {
res = append(res, drive.Name)
}
}
return res
}