Add some docs

This commit is contained in:
Violet Caulfield
2025-03-22 01:55:27 -05:00
parent be21994bfd
commit 328d68fe2d

View File

@@ -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!,