mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-06-06 16:14:59 +08:00
fix: improve file listing and path handling in Webdav storage
This commit is contained in:
@@ -129,9 +129,12 @@ func (w *Webdav) ListFiles(ctx context.Context, dirPath string) ([]storagetypes.
|
|||||||
|
|
||||||
isDir := resp.Propstat.Prop.ResourceType.IsCollection()
|
isDir := resp.Propstat.Prop.ResourceType.IsCollection()
|
||||||
|
|
||||||
|
filePath := strings.TrimPrefix(decodedHref, path.Join("/", strings.Trim(path.Dir(fullPath), "/")))
|
||||||
|
filePath = strings.TrimPrefix(filePath, "/")
|
||||||
|
|
||||||
fileInfo := storagetypes.FileInfo{
|
fileInfo := storagetypes.FileInfo{
|
||||||
Name: name,
|
Name: name,
|
||||||
Path: strings.TrimPrefix(decodedHref, w.config.BasePath),
|
Path: path.Join(dirPath, name),
|
||||||
Size: resp.Propstat.Prop.GetContentLength,
|
Size: resp.Propstat.Prop.GetContentLength,
|
||||||
IsDir: isDir,
|
IsDir: isDir,
|
||||||
ModTime: modTime,
|
ModTime: modTime,
|
||||||
|
|||||||
Reference in New Issue
Block a user