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 — e.g. 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 startingPoint and selectedAudioStreamIndex on the returned AA after creation.

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