From 2b23523bec2b42c443d6728c47c7d44852ce4ad7 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 9 May 2023 15:17:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=80=BB=E5=85=B1=E6=9D=A1=E6=95=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20(#952)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/files/fileinfo.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/utils/files/fileinfo.go b/backend/utils/files/fileinfo.go index 5d108b1bd..7c0b00df6 100644 --- a/backend/utils/files/fileinfo.go +++ b/backend/utils/files/fileinfo.go @@ -113,7 +113,6 @@ func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, tot scanner := bufio.NewScanner(output) for scanner.Scan() { line := scanner.Text() - fmt.Println(line) info, err := os.Stat(line) if err != nil { continue @@ -159,8 +158,6 @@ func (f *FileInfo) listChildren(dir, showHidden, containSub bool, search string, } } - f.ItemTotal = 0 - var items []*FileInfo for _, df := range files { if dir && !df.IsDir() { @@ -222,7 +219,9 @@ func (f *FileInfo) listChildren(dir, showHidden, containSub bool, search string, } items = append(items, file) } - f.ItemTotal = total + if containSub { + f.ItemTotal = total + } start := (page - 1) * pageSize end := pageSize + start var result []*FileInfo