What a search ended with, and what the search screen shows for it. SearchTask reports the status; SearchResults shows the view. Pure, so the rules are unit-tested without a network seam. Also which reads a search sends (canSearchLiveTv), since a read the server refuses would make every search look partial.
A read that failed says nothing about what the server holds, so a search that got no answer must never read as one that found nothing: "failed" offers Try again, "empty" says there are no results. A search whose reads partly answered shows what arrived and says some is missing.
Members
(static, constant) SHOW_EMPTY
- Default Value
- empty
(static, constant) SHOW_FAILED
- Default Value
- failed
(static, constant) SHOW_RESULTS
- Default Value
- results
(static, constant) STATUS_FAILED
- Default Value
- failed
(static, constant) STATUS_OK
- Default Value
- ok
(static, constant) STATUS_PARTIAL
- Default Value
- partial
Methods
(static) canSearchLiveTv(policy) → {boolean}
Whether a search sends its Live TV program read. Jellyfin refuses that read to a user without Live TV access (its LiveTvAccess policy), so asking would count every one of that user's searches as partial. A policy, or a field, that is missing reads as allowed, as SessionDataTransformer defaults it.
| Name | Type | Description |
|---|---|---|
policy | dynamic | m.global.user.policy (JellyfinUserPolicy node or AA), or invalid |
true when the search asks for Live TV programs
- Type:
- boolean
(static) statusOf(sentCount, failedCount) → {string}
How a search's reads ended: every one answered, some did, or none did. A search that sent nothing (no read could be built) failed, since nothing answered for it.
| Name | Type | Description |
|---|---|---|
sentCount | integer | the reads asked for |
failedCount | integer | the reads that did not answer |
a STATUS_ constant
- Type:
- string
(static) view(status, itemCount) → {object}
What the screen shows for a search that ended with status and itemCount items, the toast to raise with it, and what the screen reader announces ("" for none). A partial search that found nothing is a failure: the reads that answered say nothing about the ones that did not. A status that is none of these reads as failed, since nobody can vouch for its empty list.
Failed and empty are announced because focus stays on the keyboard, and the screen reader speaks only what has focus: without it, neither is heard. Results need no announcement (the viewer moves into them), and a partial search's toast is its notice.
| Name | Type | Description |
|---|---|---|
status | dynamic | a STATUS_ constant |
itemCount | integer | the items the search found |
{ show: a SHOW_ constant, toastKey and announceKey: a translation key or "" }
- Type:
- object