Fetching a set of items' MediaSources by id.
Two features ask the same question — "which version ids belong to these items?" — and both reach it from a Task thread holding a list of ids:
episodeQueue.collapseCopies(), choosing one copy per episode on a pre-12 server, where the server lists every file of an episode as its own episode the display-progress correction (versionResume's DISPLAY section), mapping a grouped tile back to whichever of its versions is in progress
It lives here rather than inside either of them because neither owns it. Fields=MediaSources is the expensive field on any item query, so asking for it BY ID — rather than for a whole page — is what keeps the cost tied to the few items that need it.
Members
(static, constant) IDS_PER_REQUEST
How many ids one request names. Each costs 35 bytes of URL (32 hex + an encoded comma), so 100 keeps a request near 3.5 KB — well inside common request-line limits.
- Default Value
- 100
Methods
(static) byIds(ids, requestId) → {object}
byIds: Each item's MediaSources, by item id.
The imperative half — runs on a Task thread, blocking, IDS_PER_REQUEST ids per request. An id the server does not answer for is simply ABSENT from the result; every caller reads that as "no versions known" rather than as an error, so a partial answer degrades instead of failing the screen.
| Name | Type | Description |
|---|---|---|
ids | object | array of item id strings |
requestId | string | for the pool |
AA of item id -> MediaSources array
- Type:
- object
(static) idChunks(ids, size) → {object}
idChunks: The ids split into runs of at most size, in order — one request each.
| Name | Type | Description |
|---|---|---|
ids | object | array of strings |
size | integer | the most ids in one run (at least 1) |
array of arrays
- Type:
- object