mirror of https://github.com/Xhofe/alist
✨ delete cache file
parent
e4d254e4b0
commit
36d52e0b75
|
@ -111,18 +111,13 @@ func (c Cloud189) Path(path string, account *model.Account) (*model.File, []*mod
|
|||
log.Debugf("189 path: %s", path)
|
||||
cache, err := conf.Cache.Get(conf.Ctx, fmt.Sprintf("%s%s", account.Name, path))
|
||||
if err == nil {
|
||||
file, ok := cache.(Cloud189File)
|
||||
if ok {
|
||||
return c.FormatFile(&file), nil, nil
|
||||
} else {
|
||||
files, _ := cache.([]Cloud189File)
|
||||
if len(files) != 0 {
|
||||
res := make([]*model.File, 0)
|
||||
for _, file = range files {
|
||||
res = append(res, c.FormatFile(&file))
|
||||
}
|
||||
return nil, res, nil
|
||||
files, _ := cache.([]Cloud189File)
|
||||
if len(files) != 0 {
|
||||
res := make([]*model.File, 0)
|
||||
for _, file := range files {
|
||||
res = append(res, c.FormatFile(&file))
|
||||
}
|
||||
return nil, res, nil
|
||||
}
|
||||
}
|
||||
// no cache or len(files) == 0
|
||||
|
|
|
@ -230,18 +230,13 @@ func (a AliDrive) Path(path string, account *model.Account) (*model.File, []*mod
|
|||
log.Debugf("ali path: %s", path)
|
||||
cache, err := conf.Cache.Get(conf.Ctx, fmt.Sprintf("%s%s", account.Name, path))
|
||||
if err == nil {
|
||||
file, ok := cache.(AliFile)
|
||||
if ok {
|
||||
return a.FormatFile(&file), nil, nil
|
||||
} else {
|
||||
files, _ := cache.([]AliFile)
|
||||
if len(files) != 0 {
|
||||
res := make([]*model.File, 0)
|
||||
for _, file = range files {
|
||||
res = append(res, a.FormatFile(&file))
|
||||
}
|
||||
return nil, res, nil
|
||||
files, _ := cache.([]AliFile)
|
||||
if len(files) != 0 {
|
||||
res := make([]*model.File, 0)
|
||||
for _, file := range files {
|
||||
res = append(res, a.FormatFile(&file))
|
||||
}
|
||||
return nil, res, nil
|
||||
}
|
||||
}
|
||||
// no cache or len(files) == 0
|
||||
|
|
|
@ -15,6 +15,7 @@ type Driver interface {
|
|||
Proxy(c *gin.Context)
|
||||
Preview(path string, account *model.Account) (interface{}, error)
|
||||
// TODO
|
||||
//Search(path string, keyword string, account *model.Account) ([]*model.File, error)
|
||||
//MakeDir(path string, account *model.Account) error
|
||||
//Move(src string, des string, account *model.Account) error
|
||||
//Delete(path string) error
|
||||
|
|
Loading…
Reference in New Issue