From df5befd41d0127c124f797678261d05b05e49d96 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Mon, 1 Apr 2024 13:14:00 +0530 Subject: [PATCH] fix: no subtitle option not selecting --- src/routes/episode/index.tsx | 3 ++- src/routes/item/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/episode/index.tsx b/src/routes/episode/index.tsx index a17c98b..cb2aace 100644 --- a/src/routes/episode/index.tsx +++ b/src/routes/episode/index.tsx @@ -197,7 +197,8 @@ const EpisodeTitlePage = () => { item.data.MediaSources[0].DefaultAudioStreamIndex ?? null, ); setSelectedSubtitleTrack( - item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1 + item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1 || + !item.data.MediaSources[0].DefaultSubtitleStreamIndex ? "nosub" : item.data.MediaSources[0].DefaultSubtitleStreamIndex, ); diff --git a/src/routes/item/index.tsx b/src/routes/item/index.tsx index 3cd258e..9cba340 100644 --- a/src/routes/item/index.tsx +++ b/src/routes/item/index.tsx @@ -230,7 +230,8 @@ const ItemDetail = () => { item.data.MediaSources[0].DefaultAudioStreamIndex ?? null, ); setSelectedSubtitleTrack( - item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1 + item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1 || + !item.data.MediaSources[0].DefaultSubtitleStreamIndex ? "nosub" : item.data.MediaSources[0].DefaultSubtitleStreamIndex, );