mirror of https://github.com/Xhofe/alist
fix(search): file type
parent
a73a40133d
commit
4c22f37d54
|
@ -2,7 +2,6 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Xhofe/alist/conf"
|
"github.com/Xhofe/alist/conf"
|
||||||
"github.com/Xhofe/alist/utils"
|
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -87,5 +86,5 @@ func (f File) IsDir() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f File) GetType() int {
|
func (f File) GetType() int {
|
||||||
return utils.GetFileType(utils.Ext(f.GetName()))
|
return f.Type
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ type SearchReq struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Search(c *gin.Context) {
|
func Search(c *gin.Context) {
|
||||||
if conf.GetBool("enable search") {
|
if !conf.GetBool("enable search") {
|
||||||
common.ErrorStrResp(c, "Not allowed search", 403)
|
common.ErrorStrResp(c, "Not allowed search", 403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue