mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
lsjson: add --no-mimetype flag, speed up lsf
Before this changed we unconditionally fetched the MimeType. On Some backends like s3 and swift this takes an extra transaction which meant that `lsf` on those backends was needlessly slow. This adds an internal option so `lsf` can declare whether it wants MimeTypes or not depending on whether the user asked for them and an external flag `--no-mimetype` for `lsjson`. See: https://forum.rclone.org/t/reliably-setup-incremental-updates/14006/8
This commit is contained in:
@@ -166,10 +166,11 @@ func Lsf(ctx context.Context, fsrc fs.Fs, out io.Writer) error {
|
||||
list.SetDirSlash(dirSlash)
|
||||
list.SetAbsolute(absolute)
|
||||
var opt = operations.ListJSONOpt{
|
||||
NoModTime: true,
|
||||
DirsOnly: dirsOnly,
|
||||
FilesOnly: filesOnly,
|
||||
Recurse: recurse,
|
||||
NoModTime: true,
|
||||
NoMimeType: true,
|
||||
DirsOnly: dirsOnly,
|
||||
FilesOnly: filesOnly,
|
||||
Recurse: recurse,
|
||||
}
|
||||
|
||||
for _, char := range format {
|
||||
@@ -188,6 +189,7 @@ func Lsf(ctx context.Context, fsrc fs.Fs, out io.Writer) error {
|
||||
list.AddID()
|
||||
case 'm':
|
||||
list.AddMimeType()
|
||||
opt.NoMimeType = false
|
||||
case 'e':
|
||||
list.AddEncrypted()
|
||||
opt.ShowEncrypted = true
|
||||
|
||||
Reference in New Issue
Block a user