From 9d9377f65d4aae539a8440d7440b794f452ae5bd Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Mon, 16 Jan 2023 20:02:30 +0800 Subject: [PATCH] fix(local): incorrect path of thumbnail (for 6453ae0) --- drivers/local/driver.go | 4 ++-- internal/fs/list.go | 2 +- internal/model/args.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/local/driver.go b/drivers/local/driver.go index be9d2ed2..1a3d8e29 100644 --- a/drivers/local/driver.go +++ b/drivers/local/driver.go @@ -69,9 +69,9 @@ func (d *Local) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([ } thumb := "" if d.Thumbnail && utils.GetFileType(f.Name()) == conf.IMAGE { - thumb = common.GetApiUrl(nil) + stdpath.Join("/d", utils.GetFullPath(d.MountPath, fullPath), f.Name()) + thumb = common.GetApiUrl(nil) + stdpath.Join("/d", args.ReqPath, f.Name()) thumb = utils.EncodePath(thumb, true) - thumb += "?type=thumb&sign=" + sign.Sign(stdpath.Join(utils.GetFullPath(d.MountPath, fullPath), f.Name())) + thumb += "?type=thumb&sign=" + sign.Sign(stdpath.Join(args.ReqPath, f.Name())) } isFolder := f.IsDir() || isSymlinkDir(f, fullPath) var size int64 diff --git a/internal/fs/list.go b/internal/fs/list.go index 29ed0a57..51775efc 100644 --- a/internal/fs/list.go +++ b/internal/fs/list.go @@ -23,7 +23,7 @@ func list(ctx context.Context, path string, refresh ...bool) ([]model.Obj, error var _objs []model.Obj if storage != nil { _objs, err = op.List(ctx, storage, actualPath, model.ListArgs{ - //ReqPath: path, + ReqPath: path, }, refresh...) if err != nil { log.Errorf("%+v", err) diff --git a/internal/model/args.go b/internal/model/args.go index b832ed8e..b3655476 100644 --- a/internal/model/args.go +++ b/internal/model/args.go @@ -7,7 +7,7 @@ import ( ) type ListArgs struct { - //ReqPath string + ReqPath string } type LinkArgs struct {