Skip to content

Commit

Permalink
feat(crypt): add show hidden option (#5554)
Browse files Browse the repository at this point in the history
  • Loading branch information
textrix committed Nov 23, 2023
1 parent 0fbb986 commit fe34d30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/crypt/driver.go
Expand Up @@ -124,6 +124,9 @@ func (d *Crypt) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([
//filter illegal files
continue
}
if !d.ShowHidden && strings.HasPrefix(name, ".") {
continue
}
objRes := model.Object{
Name: name,
Size: 0,
Expand All @@ -145,6 +148,9 @@ func (d *Crypt) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([
//filter illegal files
continue
}
if !d.ShowHidden && strings.HasPrefix(name, ".") {
continue
}
objRes := model.Object{
Name: name,
Size: size,
Expand Down
2 changes: 2 additions & 0 deletions drivers/crypt/meta.go
Expand Up @@ -21,6 +21,8 @@ type Addition struct {
FileNameEncoding string `json:"filename_encoding" type:"select" required:"true" options:"base64,base32,base32768" default:"base64" help:"for advanced user only!"`

Thumbnail bool `json:"thumbnail" required:"true" default:"false" help:"enable thumbnail which pre-generated under .thumbnails folder"`

ShowHidden bool `json:"show_hidden" default:"true" required:"false" help:"show hidden directories and files"`
}

var config = driver.Config{
Expand Down

0 comments on commit fe34d30

Please sign in to comment.