fix: default subtitle not being selected properly

This commit is contained in:
Prayag Prajapati committed 2024-03-30 10:02:04 +05:30
1 parent ef01012d0f
commit 14e0766b9c
3 files changed
+8 -4

No files matched your search

+3 -1
View File
@@ -197,7 +197,9 @@ const EpisodeTitlePage = () => {
item.data.MediaSources[0].DefaultAudioStreamIndex ?? null,
);
setSelectedSubtitleTrack(
item.data.MediaSources[0].DefaultSubtitleStreamIndex ?? "nosub",
item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1
? "nosub"
: item.data.MediaSources[0].DefaultSubtitleStreamIndex,
);
setVideoTracks(videos);
+3 -1
View File
@@ -230,7 +230,9 @@ const ItemDetail = () => {
item.data.MediaSources[0].DefaultAudioStreamIndex ?? null,
);
setSelectedSubtitleTrack(
item.data.MediaSources[0].DefaultSubtitleStreamIndex ?? "nosub",
item.data.MediaSources[0].DefaultSubtitleStreamIndex === -1
? "nosub"
: item.data.MediaSources[0].DefaultSubtitleStreamIndex,
);
setVideoTracks(videos);
+2 -2
View File
@@ -269,7 +269,7 @@ const SearchPage = () => {
item.EndDate
? new Date(item.EndDate).toLocaleString([], {
year: "numeric",
})
})
: "Present"
}`}
cardType="portrait"
@@ -430,7 +430,7 @@ const SearchPage = () => {
book.data.Items.length === 0 &&
musicArtists.data.Items.length === 0 &&
person.data.Items.length === 0 &&
episodes.data.SearchHints.length === 0 && (
episodes.data.SearchHints?.length === 0 && (
<div
style={{
height: "calc(100vh - 12em)",