diff --git a/pkg/app/req_search.go b/pkg/app/req_search.go index 58e8ce2..e19ca57 100644 --- a/pkg/app/req_search.go +++ b/pkg/app/req_search.go @@ -5,6 +5,7 @@ import ( "strconv" "github.com/gowsp/cloud189/pkg" + "github.com/gowsp/cloud189/pkg/file" ) func (d *api) Search(parent pkg.File, fileType pkg.FileType, name string) ([]pkg.File, error) { @@ -34,6 +35,9 @@ func (l *searchResult) fill(id string) (data []pkg.File) { } func (c *api) search(id, fileType, name string, page int) (result []pkg.File, err error) { + if file.IsSystem(id, name) { + return c.List(file.Root, pkg.DIR) + } params := make(url.Values) params.Set("folderId", id) params.Set("filename", name) diff --git a/pkg/app/req_space.go b/pkg/app/req_space.go index 0c3616f..f12754f 100644 --- a/pkg/app/req_space.go +++ b/pkg/app/req_space.go @@ -54,7 +54,7 @@ func (a *api) signReq(url string) { a.invoker.Refresh() a.signReq(url) default: - log.Printf("obtain: %s" + e.PrizeName) + log.Printf("obtain: %s", e.PrizeName) } } else { log.Println(err) diff --git a/pkg/drive/drive_test.go b/pkg/drive/drive_test.go index bfc4ab9..15197e5 100644 --- a/pkg/drive/drive_test.go +++ b/pkg/drive/drive_test.go @@ -56,8 +56,9 @@ func TestUpload(t *testing.T) { api := app.New(invoker.DefaultPath()) fs := New(api) cfg := pkg.UploadConfig{Num: 3} - fs.Upload(cfg, "/home", "D:/repo/go/src/github.com/gowsp/cloud189/docs/html") - fs.Upload(cfg, "/", "D:/tmp/01.txt") + // fs.Upload(cfg, "/home", "D:/repo/go/src/github.com/gowsp/cloud189/docs/html") + // fs.Upload(cfg, "/", "D:/tmp/01.txt") + fs.Upload(cfg, "/", "../") // f, _ := os.Open("drive_test.go") // l := file.NewLocalFile("-11", f) // api.Uploader().Write(l) diff --git a/pkg/drive/upload.go b/pkg/drive/upload.go index ead2515..522d224 100644 --- a/pkg/drive/upload.go +++ b/pkg/drive/upload.go @@ -48,8 +48,9 @@ func (client *FS) Upload(cfg pkg.UploadConfig, cloud string, locals ...string) e if !cfg.Match(v.Name()) { continue } + r := v task.Run(func() { - if err = uploader.Write(v); err != nil { + if err = uploader.Write(r); err != nil { log.Println(err) } })