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")
| Name | Type | Description |
|---|---|---|
channels | integer | Number of audio channels |
- 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)"
| Name | Type | Description |
|---|---|---|
stream | object | Audio MediaStream object from Jellyfin API |
- 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.
| Name | Type | Description |
|---|---|---|
stream | object | Subtitle MediaStream object from Jellyfin API |
- 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)
| Name | Type | Description |
|---|---|---|
stream | object | Video MediaStream object from Jellyfin API |
- 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").
| Name | Type | Description |
|---|---|---|
mediaSource | object | A MediaSource object from Jellyfin API (must have mediaStreams array) |
hasMultipleSources | boolean | True when item has more than one MediaSource version |
- 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.
| Name | Type | Description |
|---|---|---|
width | integer | Video width in pixels |
height | integer | Video height in pixels |
isInterlaced | boolean | Whether the video is interlaced |
- Resolution label (e.g., "4K", "1080p", "720i") or "" if below all thresholds
- Type:
- string
(static) resolveLanguageName(langCode) → {string}
resolveLanguageName: Convert a media stream language code to a localized display name.
MediaStream.Language passes through whatever the container metadata holds — ffmpeg/Jellyfin do not normalize, so real-world inputs include ISO 639-2/T ("fra"), 639-2/B ("fre"), 639-1 ("fr"), and BCP-47 tags ("fr-FR", "pt_BR").
Three-tier resolution chain:
- Lowercase + strip after first "-" or "_" (drop region/script suffix)
- "und" / "zxx" → "" — caller omits the language label
- Alias map → normalize 3-letter / deprecated codes to a base form
- Tier 1: translationKey lookup → translate() — localized to user's UI
- Tier 2: English-name fallback → covers every other ISO 639-2 code
- Tier 3: raw code passthrough — last-resort, preserves info
"und" (Undefined) and "zxx" (No linguistic content — instrumental music, ambient sound, foley) are both omitted: rendering "No linguistic content EAC3 5.1" as a track label is noisier than just "EAC3 5.1". The other ISO 639-2 special codes ("mul" Multiple, "mis" Uncoded) ARE displayed because they convey real information when they appear.
| Name | Type | Description |
|---|---|---|
langCode | string | Media stream language code from any common format |
- Localized name, English fallback, "" for und/zxx, or raw code
- Type:
- string