nodeHelpers

Interfaces

QueueItem

Methods

(static) createQueueItem(sourceNode) → {object}

createQueueItem: Create a queue item AA from a source item.

The queue item is a thin AA. It carries only what the queue infrastructure and the players need, not a full deep copy (that was the original perf win). Video items stay minimal: LoadVideoContentTask re-fetches all metadata server-side via ItemMetaData() on mount. AUDIO is different: the audio player advances IN PLACE and AudioPlayerView renders the now-playing text/poster directly off the queue item, so the display fields (name/artists/albumArtist/ albumName/albumId/image tags) must be carried; without them every track change paid a redundant per-track metadata fetch whose latency popped the artist/album in late.

Accepts either a JellyfinBaseItem node (typed camelCase fields) or a raw Jellyfin API response AA (PascalCase fields). BrightScript AA lookup is case-insensitive, so field access works identically for both. For example, sourceNode.backdropImageTags finds BackdropImageTags on a raw API AA and backdropImageTags on a typed node.

Fields always present in the returned AA (guaranteed contract):

  • backdropImageTags: Array of backdrop image tags (empty array = no backdrop)
  • parentBackdropImageTags: Array of parent backdrop tags (empty array = none)
  • parentBackdropItemId: Parent item ID for parent backdrops (empty string = none)

Fields present only when non-empty / non-zero:

  • id: Item identifier (required for playback)
  • type: Media type (required for queue routing)
  • title: Display title
  • mediaSourceId: Media source hint
  • runTimeTicks: Runtime duration
  • name / artists / albumArtist / albumName / albumId / albumPrimaryImageTag / primaryImageTag: now-playing display fields (audio plays in place; see header)
  • seriesId: Series ID for episode navigation in resume dialog
  • seasonId: Season ID for episode navigation in resume dialog
  • playbackPositionTicks: Saved resume position

Callers set selectedAudioStreamIndex on the returned AA after creation, and the start position through setResumeStart() or setExactStart().

Returns object, not QueueItem: the queue item is used as a real roAssociativeArray (callers/tests use DoesExist/Count), and typing it as the interface would strip those AA methods. The QueueItem interface is the documented, opt-in shape (type a local as nodeHelpers.QueueItem for autocomplete); the createQueueItem spec is the enforced gate.

Parameters:
NameTypeDescription
sourceNodeobject

JellyfinBaseItem node or raw Jellyfin API response AA

Returns:

Associative array with guaranteed field contract, or invalid if sourceNode is invalid

Type: 
object

(static) findOptionsPanel(group) → {dynamic}

findOptionsPanel: The options panel of a view, or invalid when the view has none. A view can report isOptionsAvailable (JRGroup defaults it to true) without owning an "options" node, so JRScene asks here before it shows the panel.

Parameters:
NameTypeDescription
groupdynamic

the active view, or invalid

Returns:
  • the options panel node, or invalid
Type: 
dynamic

(static) setExactStart(queueItem, ticks) → {void}

setExactStart: Start a queue item at a place the caller named: a chapter, Play from the start, the position a reload saved. The loader never replaces it.

Parameters:
NameTypeDescription
queueItemobject

from createQueueItem()

ticksdynamic

where playback starts (0 = from the beginning)

Returns:
Type: 
void

(static) setResumeStart(queueItem, ticks) → {void}

setResumeStart: Start a queue item from its saved resume position.

The loader may replace it: on a per-version server it chooses which version resumes and starts that version at ITS OWN position, which the caller could not read.

Parameters:
NameTypeDescription
queueItemobject

from createQueueItem()

ticksdynamic

the saved position (0 = from the beginning)

Returns:
Type: 
void

(static) startFresh(queueItem) → {void}

startFresh: Start a queue item from the beginning because the viewer did not choose to resume it (QueueManager.advanceTo / startCurrentFresh). An exact start at 0, so the loader never swaps in a version's saved position; startsFresh, so it picks the version by the viewer's explicit pick instead; and no version counts as in progress, since none resumes.

Parameters:
NameTypeDescription
queueItemobject

a queue item, from createQueueItem() or a raw item in the queue

Returns:
Type: 
void