versionDisplay

The imperative shell for the display-progress correction — the half that fetches.

versionResume's DISPLAY section holds the rules and the measurements; this holds the two requests they need, in one place, because three loaders make the same correction and two copies of it had already drifted apart (scoping, caching, and where the server version was read). Every loader now gets one behaviour.

Runs on a Task thread: fetchJson blocks, which is what a Task thread is for.

Methods

(static) cacheSourcesFor(ids, requestId, cache) → {void}

cacheSourcesFor: Make sure the cache holds a sibling list for each of these tile ids.

attempted is tracked separately from the answers so an id the server returned nothing for is not re-requested by the next row that mentions it.

Parameters:
NameTypeDescription
idsobject

tile ids

requestIdstring

for the pool

cacheobject

caller-owned AA

Returns:
Type: 
void

(static) correctDisplayProgress(items, serverVersion, parentId, requestId, cache) → {integer}

correctDisplayProgress: Rewrite a list response's UserData so each tile's progress bar shows the version that would actually play.

Costs nothing at all on a pre-12 server, or for a page with nothing grouped. When a page DOES hold grouped items it makes one cheap request, and a second only if something is actually in progress — see the DISPLAY section of versionResume for why that order, and for the measurements behind asking for MediaSources by id rather than on the resume list.

cache is owned by the CALLER, which is what lets one function serve both shapes: a grid passes a fresh AA and corrects its whole page at once, while the extras orchestrator passes one AA for the run so the ranking is fetched once and sibling ids accumulate across rows.

Parameters:
NameTypeDescription
itemsdynamic

raw BaseItemDto array from a list response (mutated in place)

serverVersionstring

m.global.server.version, read ONCE by the caller

parentIdstring

scope the resume query to this container, or "" for none

requestIdstring

for the pool

cacheobject

caller-owned AA, reused across calls that share a run

Returns:

how many items were changed

Type: 
integer

(static) resumeRows(parentId, requestId) → {object}

resumeRows: Every version the viewer is part-way through, in the server's DatePlayed order.

No Fields: the sibling ids come from mediaSources.byIds() instead, which is what keeps this request's size tied to the viewer's backlog rather than multiplying it — 1.1 KB a row here against 7.3 KB with Fields=MediaSources, measured 2026-09-20 on a local 12.0 server.

Parameters:
NameTypeDescription
parentIdstring

container to scope to, or ""

requestIdstring

for the pool

Returns:

array of rows (empty when the lookup failed)

Type: 
object