mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-30 01:22:56 +01:00
fix(subtitles): order detail-page & TV subtitle menus like jellyfin-web
The detail-page selector (MediaSourceButton, the #1176 replacement for TrackSheet) and the TV detail/refresh paths (ItemContent.tv, Controls.tv refreshSubtitleTracks) still listed subtitles in raw MediaStreams order (externals first). Apply compareTracksForMenu there too so every menu matches web. The in-player TV modal was already covered (fed from the sorted VideoContext tracks).
This commit is contained in:
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
|
||||
import type { ThemeColors } from "@/hooks/useImageColorsReturn";
|
||||
import { compareTracksForMenu } from "@/utils/jellyfin/subtitleUtils";
|
||||
import { BITRATES } from "./BitRateSheet";
|
||||
import type { SelectedOptions } from "./ItemContent";
|
||||
import { type OptionGroup, PlatformDropdown } from "./PlatformDropdown";
|
||||
@@ -63,9 +64,12 @@ export const MediaSourceButton: React.FC<Props> = ({
|
||||
|
||||
const subtitleStreams = useMemo(
|
||||
() =>
|
||||
selectedOptions.mediaSource?.MediaStreams?.filter(
|
||||
(x) => x.Type === "Subtitle",
|
||||
) || [],
|
||||
// Order like jellyfin-web (embedded first, externals last, forced/default up).
|
||||
[
|
||||
...(selectedOptions.mediaSource?.MediaStreams?.filter(
|
||||
(x) => x.Type === "Subtitle",
|
||||
) || []),
|
||||
].sort(compareTracksForMenu),
|
||||
[selectedOptions.mediaSource],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user