🎇 多盘支持
This commit is contained in:
22
utils/config.go
Normal file
22
utils/config.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user