From 328d68fe2d24bf64f686dcc33daa46b0fbc81c02 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sat, 22 Mar 2025 01:55:27 -0500 Subject: [PATCH] Add some docs --- helpers/mappings.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/helpers/mappings.ts b/helpers/mappings.ts index c932fa62..7b0b9bc5 100644 --- a/helpers/mappings.ts +++ b/helpers/mappings.ts @@ -5,12 +5,27 @@ import { QueuingType } from "../enums/queuing-type"; import { getImageApi } from "@jellyfin/sdk/lib/utils/api"; import Client from "../api/client"; import { isUndefined } from "lodash"; -import { runOnRuntime } from "react-native-reanimated"; -import { backgroundRuntime } from "../App"; -// TODO: Make this configurable +/** + * The container that the Jellyfin server will attempt to transcode to + * + * This is set to `ts` (MPEG-TS), as that is what HLS relies upon + * + * Finamp and Jellyfin Web also have this set to `ts` + * @see https://jmshrv.com/posts/jellyfin-api/#playback-in-the-case-of-music + */ const transcodingContainer = "ts"; +/** + * A mapper function that can be used to get a RNTP `Track` compliant object + * from a Jellyfin server `BaseItemDto`. Applies a queuing type to the track + * object so that it can be referenced later on for determining where to place + * the track in the queue + * + * @param item The `BaseItemDto` of the track + * @param queuingType The type of queuing we are performing + * @returns A `JellifyTrack`, which represents a Jellyfin library track queued in the player + */ export function mapDtoToTrack(item: BaseItemDto, queuingType?: QueuingType) : JellifyTrack { const urlParams = { "Container": item.Container!,