mirror of
https://github.com/rclone/rclone.git
synced 2025-01-10 16:28:30 +01:00
owncloud: add config owncloud_exclude_shares
which allows to exclude shared files and folders when listing remote resources
This commit is contained in:
parent
ef2c5a1998
commit
99b9062551
@ -75,6 +75,7 @@ type Prop struct {
|
|||||||
Size int64 `xml:"DAV: prop>getcontentlength,omitempty"`
|
Size int64 `xml:"DAV: prop>getcontentlength,omitempty"`
|
||||||
Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`
|
Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`
|
||||||
Checksums []string `xml:"prop>checksums>checksum,omitempty"`
|
Checksums []string `xml:"prop>checksums>checksum,omitempty"`
|
||||||
|
Permissions string `xml:"prop>permissions,omitempty"`
|
||||||
MESha1Hex *string `xml:"ME: prop>sha1hex,omitempty"` // Fastmail-specific sha1 checksum
|
MESha1Hex *string `xml:"ME: prop>sha1hex,omitempty"` // Fastmail-specific sha1 checksum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +149,11 @@ Set to 0 to disable chunked uploading.
|
|||||||
`,
|
`,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
Default: 10 * fs.Mebi, // Default NextCloud `max_chunk_size` is `10 MiB`. See https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/apps/files/lib/App.php#L57
|
Default: 10 * fs.Mebi, // Default NextCloud `max_chunk_size` is `10 MiB`. See https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/apps/files/lib/App.php#L57
|
||||||
|
}, {
|
||||||
|
Name: "owncloud_exclude_shares",
|
||||||
|
Help: "Exclude ownCloud shares",
|
||||||
|
Advanced: true,
|
||||||
|
Default: false,
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -165,6 +170,7 @@ type Options struct {
|
|||||||
Headers fs.CommaSepList `config:"headers"`
|
Headers fs.CommaSepList `config:"headers"`
|
||||||
PacerMinSleep fs.Duration `config:"pacer_min_sleep"`
|
PacerMinSleep fs.Duration `config:"pacer_min_sleep"`
|
||||||
ChunkSize fs.SizeSuffix `config:"nextcloud_chunk_size"`
|
ChunkSize fs.SizeSuffix `config:"nextcloud_chunk_size"`
|
||||||
|
ExcludeShares bool `config:"owncloud_exclude_shares"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs represents a remote webdav
|
// Fs represents a remote webdav
|
||||||
@ -702,6 +708,7 @@ var owncloudProps = []byte(`<?xml version="1.0"?>
|
|||||||
<d:resourcetype />
|
<d:resourcetype />
|
||||||
<d:getcontenttype />
|
<d:getcontenttype />
|
||||||
<oc:checksums />
|
<oc:checksums />
|
||||||
|
<oc:permissions />
|
||||||
</d:prop>
|
</d:prop>
|
||||||
</d:propfind>
|
</d:propfind>
|
||||||
`)
|
`)
|
||||||
@ -797,6 +804,11 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if f.opt.ExcludeShares {
|
||||||
|
if strings.Contains(item.Props.Permissions, "S") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
// item.Name = restoreReservedChars(item.Name)
|
// item.Name = restoreReservedChars(item.Name)
|
||||||
if fn(remote, isDir, &item.Props) {
|
if fn(remote, isDir, &item.Props) {
|
||||||
found = true
|
found = true
|
||||||
|
Loading…
Reference in New Issue
Block a user