Methods

(static) formatAudioChannels(channels) → {string}

formatAudioChannels: Convert channel count integer to display format Ignores ChannelLayout field since it can return inconsistent strings (e.g., "stereo")

Parameters:
NameTypeDescription
channelsinteger

Number of audio channels

Returns:
  • Channel layout string (e.g., "2.0", "5.1", "7.1") or "" if invalid/zero
Type: 
string

(static) formatAudioDisplayTitle(stream) → {string}

formatAudioDisplayTitle: Build a display title for an audio stream Format: "Language CODEC CHANNELS" or "Language CODEC CHANNELS (default)"

Parameters:
NameTypeDescription
streamobject

Audio MediaStream object from Jellyfin API

Returns:
  • Formatted display title (e.g., "English AAC 2.0 (default)") or "N/A" if insufficient data
Type: 
string

(static) formatSubtitleDisplayTitle(stream) → {string}

formatSubtitleDisplayTitle: Build a display title for a subtitle stream Format: "Language CODEC", "Language CODEC (forced)", or "Language CODEC (default)" Forced takes precedence over default if both are set.

Parameters:
NameTypeDescription
streamobject

Subtitle MediaStream object from Jellyfin API

Returns:
  • Formatted display title (e.g., "English SUBRIP (forced)") or "N/A" if insufficient data
Type: 
string

(static) formatVideoDisplayTitle(stream) → {string}

formatVideoDisplayTitle: Build a display title for a video stream Format: "RESOLUTION CODEC" or "RESOLUTION CODEC RANGETYPE" (when HDR)

Parameters:
NameTypeDescription
streamobject

Video MediaStream object from Jellyfin API

Returns:
  • Formatted display title (e.g., "4K HEVC HDR10") or "N/A" if insufficient data
Type: 
string

(static) formatVideoSourceTitle(mediaSource, hasMultipleSources) → {string}

formatVideoSourceTitle: Build a display title for a video source (MediaSource) Finds the first video stream and formats it via formatVideoDisplayTitle(). When multiple sources exist (i.e., multiple versions of the same video), prepends the source Name (e.g., "[B&W] 1080p H264").

Parameters:
NameTypeDescription
mediaSourceobject

A MediaSource object from Jellyfin API (must have mediaStreams array)

hasMultipleSourcesboolean

True when item has more than one MediaSource version

Returns:
  • Formatted display title (e.g., "[B&W] 1080p H264") or "N/A" if no video stream found
Type: 
string

(static) getVideoResolutionLabel(width, height, isInterlaced) → {string}

getVideoResolutionLabel: Determine resolution label from video dimensions Resolution thresholds check width OR height (either can qualify) 4K never gets p/i suffix. All other resolutions get "p" or "i" based on interlacing.

Parameters:
NameTypeDescription
widthinteger

Video width in pixels

heightinteger

Video height in pixels

isInterlacedboolean

Whether the video is interlaced

Returns:
  • Resolution label (e.g., "4K", "1080p", "720i") or "" if below all thresholds
Type: 
string

(static) resolveLanguageName(langCode) → {string}

resolveLanguageName: Convert a 3-letter ISO 639-2 language code to its full display name Uses getSubtitleLanguages() from languages.bs as the lookup table. Falls back to the raw code if not found in the lookup table.

Parameters:
NameTypeDescription
langCodestring

3-letter ISO 639-2 language code (e.g., "eng", "spa")

Returns:
  • Full language name (e.g., "English", "Spanish") or raw code if unknown
Type: 
string