fix: restore additional=["size","time"] to list_dir, update SPEC + tests
Root cause of DSM 408 was wrong path format (volume path vs share path), not the additional parameter. Confirmed via test_additional.py that json.dumps(["size","time"]) is the correct format; comma-separated string is silently ignored by DSM. - list_dir: restore 4-column table (Name, Type, Size, Modified) - list_dir: use additional=json.dumps(["size","time"]) (confirmed working) - SPEC.md: document share path requirement, additional format rules, note SYNO.FileStation.Stat unavailability, remove comma-sep gotcha - tests: restore size/mtime mock data and assertions - delete test_additional.py (throwaway diagnostic script) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,9 +84,12 @@ List all shared folders visible to the authenticated user.
|
||||
|
||||
**DSM call:** `SYNO.FileStation.List::list_share`
|
||||
```
|
||||
additional=["real_path","volume_status"]
|
||||
additional=["volume_status"]
|
||||
```
|
||||
|
||||
> **Note:** DSM returns share paths directly (e.g. `/dev`, `/data`). The `path` field from the
|
||||
> response is used as-is — do not prepend the volume prefix.
|
||||
|
||||
---
|
||||
|
||||
#### `list_dir`
|
||||
@@ -95,7 +98,7 @@ List contents of a directory with optional pagination and sorting.
|
||||
**Parameters:**
|
||||
| Name | Type | Required | Default | Description |
|
||||
|------|------|----------|---------|-------------|
|
||||
| `path` | str | yes | — | Absolute path on the NAS |
|
||||
| `path` | str | yes | — | Share-relative path (e.g. `/dev`, `/data/photos`) |
|
||||
| `offset` | int | no | 0 | Number of items to skip |
|
||||
| `limit` | int | no | 100 | Max items to return (max 500) |
|
||||
| `sort_by` | str | no | `name` | `name`, `size`, `user`, `group`, `mtime`, `atime`, `crtime`, `posix`, `type` |
|
||||
@@ -108,9 +111,21 @@ pagination context.
|
||||
```
|
||||
folder_path={path}, offset={offset}, limit={limit},
|
||||
sort_by={sort_by}, sort_direction={sort_direction},
|
||||
additional=["real_path","size","time","perm","type"]
|
||||
additional=["size","time"]
|
||||
```
|
||||
|
||||
> **Path requirement:** `folder_path` must be a share path as returned by `list_share`
|
||||
> (e.g. `/dev`, `/data`). Volume paths (`/volume1/dev`) are **not accepted** and cause DSM
|
||||
> error 408.
|
||||
>
|
||||
> **`additional` format:** Must be a JSON array serialised as a string
|
||||
> (`json.dumps(["size","time"])` → `'["size", "time"]'`). A comma-separated string
|
||||
> (`"size,time"`) is silently ignored by DSM — the `additional` field will be absent from
|
||||
> every file entry.
|
||||
>
|
||||
> **`SYNO.FileStation.Stat`:** Not available on all NAS firmware versions. Do not use for
|
||||
> `get_info`; fall back to `SYNO.FileStation.List::list` with `additional=["size","time","perm","owner"]`.
|
||||
|
||||
---
|
||||
|
||||
#### `get_info`
|
||||
|
||||
Reference in New Issue
Block a user