From ccdd7770c904672fd485959c3f5b8090b19f72f3 Mon Sep 17 00:00:00 2001 From: Alex Kim Date: Thu, 19 Feb 2026 18:50:36 +1100 Subject: [PATCH] More fixes --- components/ItemContent.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/ItemContent.tsx b/components/ItemContent.tsx index d09ae043..5195e993 100644 --- a/components/ItemContent.tsx +++ b/components/ItemContent.tsx @@ -55,6 +55,8 @@ export const ItemContent: React.FC = React.memo( const [api] = useAtom(apiAtom); const isOffline = useOfflineMode(); const { getDownloadedItemById } = useDownload(); + const downloadedItem = + isOffline && item.Id ? getDownloadedItemById(item.Id) : null; const { settings } = useSettings(); const { orientation } = useOrientation(); const navigation = useNavigation(); @@ -95,8 +97,6 @@ export const ItemContent: React.FC = React.memo( useEffect(() => { // When offline, use the indices stored in userData (the last-used tracks for this file) // rather than the server's defaults, so MediaSourceButton reflects what will actually play. - const downloadedItem = - isOffline && item.Id ? getDownloadedItemById(item.Id) : null; const offlineUserData = downloadedItem?.userData; setSelectedOptions(() => ({ @@ -116,9 +116,8 @@ export const ItemContent: React.FC = React.memo( defaultBitrate, defaultSubtitleIndex, defaultMediaSource, - isOffline, - item.Id, - getDownloadedItemById, + downloadedItem?.userData?.audioStreamIndex, + downloadedItem?.userData?.subtitleStreamIndex, ]); useEffect(() => {