Constructor
new JellyfinDataTransformer() → {JellyfinDataTransformer}
- Type:
- JellyfinDataTransformer
Methods
populateLyrics(item, response) → {void}
Populate lyrics from a separate API call result.
| Name | Type | Description |
|---|---|---|
item | object | JellyfinBaseItem node (already transformed) |
response | object | LyricDto response from GET /Audio/{itemId}/Lyrics |
- Type:
- void
populateMediaSegments(item, segmentsResponse) → {void}
Populate media segments from a separate API call result. This is a sanctioned post-transformation mutation: data arrives via a separate API call.
| Name | Type | Description |
|---|---|---|
item | object | JellyfinBaseItem node (already transformed) |
segmentsResponse | object | Response body from GET /MediaSegments/{itemId} |
- Type:
- void
populateThemeSongs(item, response) → {void}
Populate theme songs from a separate API call result. bsc-disable-next-line dead-code keep: planned: theme songs and videos, #1070
| Name | Type | Description |
|---|---|---|
item | object | JellyfinBaseItem node (already transformed) |
response | object | Response from GET /Items/{id}/ThemeSongs |
- Type:
- void
populateThemeVideos(item, response) → {void}
Populate theme videos from a separate API call result. bsc-disable-next-line dead-code keep: planned: theme songs and videos, #1070
| Name | Type | Description |
|---|---|---|
item | object | JellyfinBaseItem node (already transformed) |
response | object | Response from GET /Items/{id}/ThemeVideos |
- Type:
- void
transformBaseItem(apiData, serverVersionopt, preferredSubtitleLanguageopt) → {object}
Transform a BaseItemDto to a JellyfinBaseItem content node.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
apiData | object | Raw BaseItemDto assocarray from the Jellyfin API | ||
serverVersion | string | <optional> | "" | Server version string (auto-detected from global session if omitted) |
preferredSubtitleLanguage | string | <optional> | "" | BCP-47 language code for subtitle sort priority (for example "eng") |
JellyfinBaseItem node, or invalid if apiData is invalid
- Type:
- object
transformBaseItemArray(apiArray, serverVersionopt, preferredSubtitleLanguageopt) → {object}
Transform an array of BaseItemDto objects. Skips invalid entries silently.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
apiArray | object | Array of BaseItemDto assocArrays | ||
serverVersion | string | <optional> | "" | Server version (auto-detected if omitted) |
preferredSubtitleLanguage | string | <optional> | "" | Language code for subtitle sort preference |
Array of JellyfinBaseItem nodes (may be shorter than input if entries were invalid)
- Type:
- object
transformPersonCard(spec) → {object}
Build a Cast & Crew card node from one spec produced by castCardSpecs().
Takes a SPEC rather than a raw BaseItemPerson because a card is not a person entry: the server sends one entry per credit, so the merge and the label both have to happen over the whole array before any node exists. people.bs owns that rule; this owns the node. primaryImageTag is set directly, not nested under ImageTags like a BaseItemDto.
| Name | Type | Description |
|---|---|---|
spec | object | one { id, name, primaryImageTag, subtitle } from castCardSpecs() |
JellyfinBaseItem node, or invalid if spec is invalid
- Type:
- object