fix(search): file type

pull/938/head
Xhofe 2022-04-08 22:47:04 +08:00
parent a73a40133d
commit 4c22f37d54
2 changed files with 2 additions and 3 deletions

View File

@ -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
} }

View File

@ -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
} }