Add half-body portrait support: update API, UI, and localization for new portrait type
ci / server (push) Failing after 3m40s
ci / client (push) Failing after 14s

This commit is contained in:
Leonid Pershin
2026-08-20 05:10:51 +03:00
parent 9e11c8c693
commit df0aaad403
19 changed files with 155 additions and 64 deletions
+5 -4
View File
@@ -264,7 +264,7 @@ overload does not slow walking. `hasLocker` is true when the pupil has an assign
is how many items remain at home, not the list. The people list does not include any of these
fields. Today's history is a separate GET.
`hasAvatar` and `hasFullBody` tell the client whether PNG files already exist on disk for this
`hasAvatar`, `hasHalfBody` and `hasFullBody` tell the client whether PNG files already exist on disk for this
person. They are filled on the HTTP thread after the worker returns the card; generation does
not happen on this request.
@@ -318,6 +318,7 @@ not happen on this request.
"hasLocker": false,
"homeCount": 3,
"hasAvatar": false,
"hasHalfBody": false,
"hasFullBody": false
}
```
@@ -357,15 +358,15 @@ the action or apparel def the caption was built from.
### `GET /api/schools/{id}/people/{personId}/portrait`
Returns a generated PNG when one exists. Query `kind=avatar|full` selects head-and-shoulders or
full-body. Unknown school is `404` `unknown-school`; unknown person is `404` `unknown-person`;
Returns a generated PNG when one exists. Query `kind=avatar|half|full` selects head-and-shoulders,
waist-up or full-body. Unknown school is `404` `unknown-school`; unknown person is `404` `unknown-person`;
missing file is `404` `portrait-missing`. Invalid `kind` is `400` `invalid-query`. Content-Type
is `image/png`. Opening the card does not generate; use POST when the player asks.
### `POST /api/schools/{id}/people/{personId}/portrait`
Generates (or regenerates) a portrait through SwarmUI on the server. Same `kind` query as GET.
Success is `201` with `{ "kind", "hasAvatar", "hasFullBody" }` and a `Location` header pointing
Success is `201` with `{ "kind", "hasAvatar", "hasHalfBody", "hasFullBody" }` and a `Location` header pointing
at GET. SwarmUI is not configured when `SwarmUi:BaseUrl` is empty — `503` `swarmui-not-configured`.
Swarm errors are `502` `swarmui-unavailable`; a slow backend is `504` `swarmui-timeout`. Files
land under `saves/{id}.portraits/` and survive until the school is deleted.