Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/changelog.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/docker.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/lint.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/release.yml

This file was deleted.

16 changes: 12 additions & 4 deletions pkg/storage/fs/posix/trashbin/trashbin.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,22 +188,21 @@ func (tb *Trashbin) ListRecycle(ctx context.Context, spaceID string, key, relati

var originalPath string
var ts *typesv1beta1.Timestamp
if key != "" {
if key != "" && relativePath == "" {
// this is listing a specific item/folder
base = filepath.Join(base, key+".trashitem", relativePath)
base = filepath.Join(base, key+".trashitem")
var err error
originalPath, ts, err = tb.readInfoFile(trashRoot, key)
if err != nil {
return nil, err
}
originalPath = filepath.Join(originalPath, relativePath)

fi, err := os.Stat(base)
if err != nil {
return nil, err
}
item := &provider.RecycleItem{
Key: filepath.Join(key, relativePath),
Key: key,
Size: uint64(fi.Size()),
Ref: &provider.Reference{
ResourceId: &provider.ResourceId{
Expand All @@ -221,6 +220,15 @@ func (tb *Trashbin) ListRecycle(ctx context.Context, spaceID string, key, relati
item.Type = provider.ResourceType_RESOURCE_TYPE_FILE
}
return []*provider.RecycleItem{item}, nil
} else if key != "" {
// this is listing a specific item/folder
base = filepath.Join(base, key+".trashitem", relativePath)
var err error
originalPath, ts, err = tb.readInfoFile(trashRoot, key)
if err != nil {
return nil, err
}
originalPath = filepath.Join(originalPath, relativePath)
}

items := []*provider.RecycleItem{}
Expand Down