photoprism/internal/remote/webdav/path.go
Michael Mayer e34c9759e4 WebDAV: Replace studio-b12/gowebdav client with emersion/go-webdav #3310
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-03-28 20:37:42 +02:00

19 lines
269 B
Go

package webdav
import (
"path"
"strings"
)
func trimPath(dir string) string {
if dir = strings.Trim(path.Clean(dir), "/"); dir != "." && dir != ".." {
return dir
}
return ""
}
func splitPath(dir string) []string {
return strings.Split(trimPath(dir), "/")
}