2021-10-26 22:28:37 +08:00
|
|
|
package model
|
|
|
|
|
2021-10-28 22:50:09 +08:00
|
|
|
import "github.com/Xhofe/alist/conf"
|
|
|
|
|
2021-10-26 22:28:37 +08:00
|
|
|
type Meta struct {
|
|
|
|
Path string `json:"path" gorm:"primaryKey"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Hide bool `json:"hide"`
|
|
|
|
Ignore bool `json:"ignore"`
|
|
|
|
}
|
2021-10-28 22:50:09 +08:00
|
|
|
|
|
|
|
func GetMetaByPath(path string) (*Meta,error) {
|
|
|
|
var meta Meta
|
|
|
|
meta.Path = path
|
|
|
|
err := conf.DB.First(&meta).Error
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &meta, nil
|
|
|
|
}
|