fix: subtitle track not setting properly on first render

This commit is contained in:
--remove-section committed 2025-12-26 17:13:32 +05:30
1 parent c0402fe8cf
commit 1c8c048df0
7 files changed
+51 -31

No files matched your search

+4
View File
@@ -176,6 +176,10 @@ const PlayButton = ({
queueItems: queue,
queueIndex: episodeIndex,
startPositionTicks: startPosition,
audioStreamIndex:
currentAudioTrack === "auto" ? undefined : currentAudioTrack,
subtitleStreamIndex:
currentSubTrack === "nosub" ? -1 : currentSubTrack,
});
navigate({ to: "/player" });
}
+2 -6
View File
@@ -6,8 +6,7 @@ import {
type ImageType,
} from "@jellyfin/sdk/lib/generated-client";
import { useNavigate } from "@tanstack/react-router";
import type React from "react";
import { memo, useCallback, useState } from "react";
import React, { memo, type Ref, useCallback, useState } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useInView } from "react-intersection-observer";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
@@ -51,7 +50,7 @@ const CardContent = ({
forwardedRef,
}: CardProps & {
inView: boolean;
forwardedRef?: React.Ref<HTMLDivElement>;
forwardedRef?: Ref<HTMLDivElement>;
}) => {
const api = useApiInContext((s) => s.api);
const navigate = useNavigate();
@@ -175,9 +174,6 @@ const CardContent = ({
item={item}
userId={userId}
itemType={item.Type ?? "Movie"}
currentAudioTrack="auto"
currentSubTrack={-1}
currentVideoTrack={0}
className="card-play-button"
iconOnly
audio={