Added work remaining url for remote extraction client

This commit is contained in:
2026-06-12 19:03:31 +02:00
parent 4c637de442
commit f1cffa7dfa
8 changed files with 220 additions and 4 deletions
+65
View File
@@ -96,6 +96,71 @@ Requires an administrator API key.
Serves the pause-overlay script that JRay injects into the web client's
`index.html` (see below). Anonymous access.
## Client: pushing results from a remote extraction worker
A worker that runs the extraction pipeline on a different machine than
Jellyfin (i.e. it cannot write a `Movie.jray.json` sidecar next to the media
file) can push results directly over HTTP.
### 1. Authenticate
Create an **Administrator** API key in Jellyfin (Dashboard → API Keys), and
send it on every request as either:
```
X-Emby-Token: <api-key>
```
or:
```
Authorization: MediaBrowser Token="<api-key>"
```
### 2. Resolve the Jellyfin item id
The push endpoint is keyed by the Jellyfin item GUID, not by file path. To
find it for `Movie.mkv`:
```
GET /Items?Recursive=true&Fields=Path&IncludeItemTypes=Movie,Episode
```
(use `&ParentId=<library-id>` to narrow the search if the library is large).
Each returned item DTO has `Id` (the GUID) and `Path`. Match `Path` against
the absolute path of the file you just processed — note this requires the
worker to see the file at the *same path* Jellyfin does (same mount/share);
translate paths first if the worker mounts the library elsewhere.
This mapping is stable until the file is moved/re-scanned, so the worker
should cache `path -> itemId` and only re-resolve on a cache miss.
### 3. Push the truth file
```
PUT /Plugins/JRay/Items/{itemId}/Truth
Content-Type: application/json
<truth file JSON, schema_version 1, as produced by result_sink_node>
```
- `204 No Content` — stored. Takes effect immediately (any cached read for
this item is invalidated server-side).
- `400 Bad Request``schema_version` is not `1`.
- `401`/`403` — API key missing or not an administrator.
The `PUT` is idempotent (replaces any existing managed truth for the item),
so the worker can safely retry on network errors.
### 4. (Optional) Remove pushed data
```
DELETE /Plugins/JRay/Items/{itemId}/Truth
```
Always returns `204`. The item falls back to a sidecar `Movie.jray.json` (if
any) on the next read.
## Web client pause overlay
Since Jellyfin has no plugin hook for player UI, JRay injects