mirror of
https://github.com/alist-org/alist.git
synced 2026-06-05 21:04:08 +08:00
The existing `path` field on ObjResp/ObjLabelResp returns whatever the storage driver writes into model.Object.Path, and that contract has quietly diverged across drivers: - Local sets it to the physical disk path (e.g. `/data/data/com.termux/files/home/storage/download/foo.tar.gz`) - Cloud drivers (Quark / Baidu / 115 / …) leave it empty - Some other drivers fill it with their own internal id-like path Clients that need the canonical alist virtual path (e.g. for `share`, `fs/copy`, navigation) cannot rely on `path` alone. The frontend has been working around this with branchy code such as `pathJoin(getCurrentPath(), name)` in some places and `obj.path` in others; one such mismatch caused a share regression on Local mounts whose root_folder_path differs from the mount path (visible as `failed get storage: storage not found; rawPath: ...`). Add a `virtual_path` field that is always the alist virtual path for the object: - `toObjsResp` -> `FixAndCleanPath(stdpath.Join(parent, obj.Name))` - `FsGet` -> `FixAndCleanPath(reqPath)` `path` is left untouched for backwards compatibility. Clients should prefer `virtual_path` for anything that talks to other alist APIs. |
||
|---|---|---|
| .. | ||
| archive.go | ||
| auth.go | ||
| const.go | ||
| down.go | ||
| driver.go | ||
| fsbatch.go | ||
| fsmanage.go | ||
| fsread.go | ||
| fsup.go | ||
| helper.go | ||
| index.go | ||
| label_file_binding.go | ||
| label.go | ||
| lark.go | ||
| ldap_login.go | ||
| meta.go | ||
| offline_download.go | ||
| role.go | ||
| search.go | ||
| session.go | ||
| setting.go | ||
| share_page.go | ||
| share_public.go | ||
| share.go | ||
| sshkey.go | ||
| ssologin.go | ||
| storage.go | ||
| task.go | ||
| user.go | ||
| webauthn.go | ||