MCPcopy
hub / github.com/AlistGo/alist / getRootAndPath

Method getRootAndPath

drivers/alias/util.go:45–55  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

43}
44
45func (d *Alias) getRootAndPath(path string) (string, string) {
46 if d.autoFlatten {
47 return d.oneKey, path
48 }
49 path = strings.TrimPrefix(path, "/")
50 parts := strings.SplitN(path, "/", 2)
51 if len(parts) == 1 {
52 return parts[0], ""
53 }
54 return parts[0], parts[1]
55}
56
57func (d *Alias) get(ctx context.Context, path string, dst, sub string) (model.Obj, error) {
58 obj, err := fs.Get(ctx, stdpath.Join(dst, sub), &fs.GetArgs{NoLog: true})

Callers 7

GetMethod · 0.95
ListMethod · 0.95
LinkMethod · 0.95
GetArchiveMetaMethod · 0.95
ListArchiveMethod · 0.95
ExtractMethod · 0.95
getReqPathMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected