From c7bfadd10ae371d9fac52c11c13370f2fcb1bf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:55:36 +0100 Subject: [PATCH] owncloud: add config owncloud_exclude_mounts which allows to exclude mounted folders when listing remote resources --- backend/webdav/webdav.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index f1c16f35a..6aaa9d1dd 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -154,6 +154,11 @@ Set to 0 to disable chunked uploading. Help: "Exclude ownCloud shares", Advanced: true, Default: false, + }, { + Name: "owncloud_exclude_mounts", + Help: "Exclude ownCloud mounted storages", + Advanced: true, + Default: false, }}, }) } @@ -171,6 +176,7 @@ type Options struct { PacerMinSleep fs.Duration `config:"pacer_min_sleep"` ChunkSize fs.SizeSuffix `config:"nextcloud_chunk_size"` ExcludeShares bool `config:"owncloud_exclude_shares"` + ExcludeMounts bool `config:"owncloud_exclude_mounts"` } // Fs represents a remote webdav @@ -805,10 +811,17 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file } } if f.opt.ExcludeShares { + // https: //owncloud.dev/apis/http/webdav/#supported-webdav-properties if strings.Contains(item.Props.Permissions, "S") { continue } } + if f.opt.ExcludeMounts { + // https: //owncloud.dev/apis/http/webdav/#supported-webdav-properties + if strings.Contains(item.Props.Permissions, "M") { + continue + } + } // item.Name = restoreReservedChars(item.Name) if fn(remote, isDir, &item.Props) { found = true