From 4b91c380a128a1a2d45a7926fe741e090866136e Mon Sep 17 00:00:00 2001 From: JoshiCodes <55353244+JoshiCodes@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:46:07 +0100 Subject: [PATCH] docs: describe the accept delay --- DECISIONS.md | 1 + README.md | 6 ++++-- SUMMARY.md | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index 4f2c930..607a3d5 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -29,6 +29,7 @@ One line per decision, with the reason. - The pending-users list in the report only contains users that still exist. Responses of deleted users are kept and shown without a name. - `GET /Herald/Notices/Pending` with an API key (no user) returns an empty list rather than an error. - Body format is the Markdown subset from the task (bold, italic, links, lists) rendered in the browser with DOM nodes; the server stores the text as typed. Links are limited to `http`, `https` and `mailto`. +- The wait before accepting (`AcceptDelaySeconds`, 0 to 600) is per notice and only kept for must-accept notices. It is enforced by the client script, not by the `Ack` endpoint: the server does not know when a popup appeared, and must-accept is a record of consent, not a gate. The countdown pauses while the tab is hidden. - Notice titles and ids are logged. Bodies and user names are not. ## Client injection diff --git a/README.md b/README.md index 637a9d7..94bcef2 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Jellyfin 10.11 has no "Custom HTML" setting in the dashboard. The branding page **Notices tab** - *New notice*: title, message, whether it has to be accepted, whether it is enabled, and who gets it (all users, or users picked from a list). +- *Wait before "Accept" can be clicked*: for a must-accept notice, the number of seconds (0 to 600) the *Accept* button stays locked. It shows a countdown, and only time with the tab in view counts. - The message is plain text and line breaks are kept. A small Markdown subset is understood: `**bold**`, `*italic*`, `[text](https://…)`, and lines starting with `- ` or `1. ` as lists. HTML is not interpreted; it shows up as text. - *Enabled* switches a notice off without deleting it. - *Re-show to everyone* shows the notice again to all addressed users, including those who already responded. Editing a notice does **not** do that. @@ -91,7 +92,7 @@ Jellyfin 10.11 has no "Custom HTML" setting in the dashboard. The branding page **What users see** -One notice at a time, oldest first. A normal notice has a *Close* button; clicking outside or pressing Escape also closes it and counts as dismissed. A must-accept notice has only an *Accept* button; clicking outside and Escape do nothing. The script asks for new notices after login, after a user switch, and then every 10 minutes while the tab is visible. +One notice at a time, oldest first. A normal notice has a *Close* button; clicking outside or pressing Escape also closes it and counts as dismissed. A must-accept notice has only an *Accept* button; clicking outside and Escape do nothing. If a wait is set, the button reads *Accept (12)* and unlocks when the countdown reaches zero. The script asks for new notices after login, after a user switch, and then every 10 minutes while the tab is visible. **Stats tab** @@ -108,7 +109,7 @@ All routes are under `/Herald`. Authentication is Jellyfin's normal `Authorizati | `POST` | `/Herald/Notices/{id}/Ack` | signed-in user | Body `{ "revision": 1, "action": "Accepted" }` (`Accepted` or `Dismissed`). `204` on success, `400` if a must-accept notice is dismissed, `404` if the notice is gone or not addressed to the caller, `409` if the revision is outdated. | | `GET` | `/Herald/Notices` | admin | All notices. | | `GET` | `/Herald/Notices/{id}` | admin | One notice. | -| `POST` | `/Herald/Notices` | admin | Create. Body: `Title`, `Body`, `RequireAccept`, `Enabled`, `Target: { AllUsers, UserIds }`. | +| `POST` | `/Herald/Notices` | admin | Create. Body: `Title`, `Body`, `RequireAccept`, `AcceptDelaySeconds` (0 to 600, ignored unless `RequireAccept`), `Enabled`, `Target: { AllUsers, UserIds }`. | | `PUT` | `/Herald/Notices/{id}` | admin | Update, same body. Keeps the revision. | | `DELETE` | `/Herald/Notices/{id}` | admin | Delete the notice and its responses. | | `POST` | `/Herald/Notices/{id}/Reshow` | admin | Bump the revision. | @@ -123,6 +124,7 @@ A notice looks like this: "Title": "House rules", "Body": "Be nice.", "RequireAccept": true, + "AcceptDelaySeconds": 15, "Enabled": true, "Target": { "AllUsers": false, "UserIds": ["21b3bac6acfe496bbca02a21c21e36d4"] }, "Revision": 2, diff --git a/SUMMARY.md b/SUMMARY.md index f16a3a3..f412435 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -8,14 +8,14 @@ - **Client injection**: registered with the File Transformation plugin by reflection at startup; a warning is logged when that plugin is missing. Manual fallbacks are documented. - **Watch-time stats**: playback start/progress/stop events are turned into daily per-user aggregates; `GET /Herald/Stats` and a sortable "Stats" tab show them; a daily scheduled task drops rows older than 90 days. - **Storage**: one SQLite database in Jellyfin's data directory, using the `Microsoft.Data.Sqlite` that the server ships. Versioned migrations, serialized writes. -- **Project plumbing**: xUnit test project (58 tests), `build.yaml` for jprm, a Gitea Actions workflow (build, test, package; tags and releases automatically when the version changes), the plugin repository `manifest.json`, `README.md`, `DECISIONS.md`. +- **Project plumbing**: xUnit test project (64 tests), `build.yaml` for jprm, a Gitea Actions workflow (build, test, package; tags and releases automatically when the version changes), the plugin repository `manifest.json`, `README.md`, `DECISIONS.md`. ## What was verified, and how | Check | Result | | --- | --- | | `dotnet build -c Release` | Succeeds, 0 warnings, 0 errors (template analyzers kept, warnings as errors). | -| `dotnet test -c Release` | 58 passed. Covers watch-time deltas (pause, seek, gaps, stale sessions, midnight incl. a non-UTC zone), pending-notice selection (revision bump, targeting, disabled), ack validation, the SQLite stores incl. concurrent writes and migrations, and the index.html transformer. | +| `dotnet test -c Release` | 64 passed. Covers watch-time deltas (pause, seek, gaps, stale sessions, midnight incl. a non-UTC zone), pending-notice selection (revision bump, targeting, disabled), ack validation, the SQLite stores incl. concurrent writes and migrations, and the index.html transformer. | | `jprm plugin build` | Produces `artifacts/herald_1.0.0.0.zip` containing only `Jellyfin.Plugin.Herald.dll` and `meta.json`. `jprm repo add` accepted it and generated a manifest. | | Docker, `jellyfin/jellyfin:10.11.11` + File Transformation 3.0.3.0 (its 10.11.11 build) | The zip from jprm was unpacked into `plugins/Herald_1.0.0.0/`. Log: `Loaded plugin: Herald 1.0.0.0`, `Registered the Herald client script with File Transformation 3.0.3.0`, scheduled task registered, no `[ERR]` lines. `/Plugins` reports both plugins as `Active`. | | Injection | `GET /web/index.html` and `GET /web/` contain the `