initializing webdav server
This commit is contained in:
14
pkg/webdav/misc.go
Normal file
14
pkg/webdav/misc.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package webdav
|
||||
|
||||
import "strings"
|
||||
|
||||
// getName: Returns the torrent name and filename from the path
|
||||
// /webdav/alldebrid/__all__/TorrentName
|
||||
func getName(rootDir, path string) (string, string) {
|
||||
path = strings.TrimPrefix(path, rootDir)
|
||||
parts := strings.Split(strings.TrimPrefix(path, "/"), "/")
|
||||
if len(parts) < 2 {
|
||||
return "", ""
|
||||
}
|
||||
return parts[0], strings.Join(parts[1:], "/")
|
||||
}
|
||||
Reference in New Issue
Block a user