fix oss import bug

pull/1911/head
haibingtown 2 years ago
parent 88409cc1f0
commit 8587d18868

@ -172,14 +172,24 @@ func (handler *Driver) List(ctx context.Context, base string, recursive bool) ([
if err != nil { if err != nil {
continue continue
} }
res = append(res, response.Object{ if strings.HasSuffix(object.Key, "/") {
Name: path.Base(object.Key), res = append(res, response.Object{
Source: object.Key, Name: path.Base(object.Key),
RelativePath: filepath.ToSlash(rel), RelativePath: filepath.ToSlash(rel),
Size: uint64(object.Size), Size: 0,
IsDir: false, IsDir: true,
LastModify: object.LastModified, LastModify: time.Now(),
}) })
} else {
res = append(res, response.Object{
Name: path.Base(object.Key),
Source: object.Key,
RelativePath: filepath.ToSlash(rel),
Size: uint64(object.Size),
IsDir: false,
LastModify: object.LastModified,
})
}
} }
return res, nil return res, nil

Loading…
Cancel
Save