Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,55 @@ refuses to install a bare plugin binary that declares them; see
an empty key or base URL, so a plugin that declares either flag needs its own
client for connections without them.

### Requester options

By default a request goes out with the settings the admin saved on the server,
or a routing rule's. A plugin can let the requester, or the admin who
approves, choose some of them, such as a quality profile, by listing the
config fields in its manifest:

```json
{
"type": "request_router.v1",
"id": "seerr",
"request_router": {
"requester_options": [
{ "field": "radarr_profile_id", "media_type": "movie", "label": "Quality", "chooser_field": "profile_chosen_by" },
{ "field": "sonarr_profile_id", "media_type": "series", "label": "Quality", "chooser_field": "profile_chosen_by" }
]
}
}
```

- `field`: a select field of the capability's admin form with
`dynamic_options`, over a string property of the `json_schema`. The host
offers the choices `ListConfigOptions` returns for it on the server the
request would go to, and sets the pick as that string.
- `media_type`: `movie` or `series`; empty offers the option for both. A field
may be listed once per media type.
- `label`: what requesters see, at most 24 characters on a single line. Empty
means the form field's label.
- `chooser_field`: a select in the same form that lists its own options, each
with one of these values, so an admin decides per server who chooses:
- `admin`: nobody; the saved value applies. Also what any other or missing
value means.
- `requester`: the requester when requesting. An approving admin may change
the pick.
- `approver`: the admin when approving.

Empty lets requesters choose on every server. Because it is a select, a
routing rule can override it like any other.

The plugin needs no other code. The host checks a pick against
the listed choices and passes it to `Fulfill` as that key of
`RouterConnection.config`, over the server's own value and a routing rule's.
When nobody picks, the config stays as the admin set it. Every
choice `ListConfigOptions` returns for the field is open to every requester
who may request, so list only fields whose choices are safe to hand out.
A host that predates the field ignores it when it installs the plugin from
an archive. [docs/compatibility.md](docs/compatibility.md) lists the two
cases where an older host rejects it.

### Wording

Silo clients draw a request as four steps: requested, approved, the router's
Expand Down
18 changes: 18 additions & 0 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ metadata stored when the plugin was installed or updated. A host built on an
older SDK stored that metadata without them, so they take effect after the
plugin is next updated on a host that reads them.

`RequestRouterDescriptor.requester_options` is a repeated message field read
from the manifest. Empty, or an absent descriptor, means requesters choose
nothing, which is the behaviour hosts had before the field existed. Hosts that
predate it drop it as an unknown field when they load a plugin archive's
manifest, which every SDK version does, and never offer the choice, so a
plugin can declare options without raising its minimum host version. Two
decoding paths are stricter. Silo reads a bare plugin binary's manifest
strictly, so a Silo host that predates the field refuses to install a binary
that declares it; install it from an archive there. And a host built on an SDK
older than v0.13.1 rejects stored capability metadata that carries a field it
does not know, so in a cluster that shares one database, upgrade such nodes
before a plugin that declares options is installed. The plugin's RPCs do not change: a host
that reads the field passes a requester's or approving admin's pick as a key of
`RouterConnection.config`, where the plugin already reads the admin's value.
Hosts read the field from the capability metadata stored when the plugin was
installed or updated, so it takes effect after the plugin is next updated on a
host that reads it.

`MetadataItem.overview_language` and the `title_language` and
`overview_language` fields on `SeasonRecord` and `EpisodeRecord` (added in
v0.29.0) are plain strings, like the older `MetadataItem.title_language`.
Expand Down
Loading