mirror of https://github.com/Xhofe/alist
18 lines
438 B
Go
18 lines
438 B
Go
package common
|
|
|
|
import (
|
|
stdpath "path"
|
|
|
|
"github.com/alist-org/alist/v3/internal/conf"
|
|
"github.com/alist-org/alist/v3/internal/model"
|
|
"github.com/alist-org/alist/v3/internal/setting"
|
|
"github.com/alist-org/alist/v3/internal/sign"
|
|
)
|
|
|
|
func Sign(obj model.Obj, parent string, encrypt bool) string {
|
|
if obj.IsDir() || (!encrypt && !setting.GetBool(conf.SignAll)) {
|
|
return ""
|
|
}
|
|
return sign.Sign(stdpath.Join(parent, obj.GetName()))
|
|
}
|