mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-15 06:59:10 +01:00
cleaned up
This commit is contained in:
parent
eaf62c92a7
commit
04f67df289
@ -151,14 +151,16 @@ export function createCastingStateProvider(
|
|||||||
if (state.source?.caption?.id) {
|
if (state.source?.caption?.id) {
|
||||||
let captionIndex: number | undefined;
|
let captionIndex: number | undefined;
|
||||||
const linkedCaptions = state.meta?.captions;
|
const linkedCaptions = state.meta?.captions;
|
||||||
const captionId = state.source?.caption?.id;
|
const captionLangIso = state.source?.caption?.id.slice(7);
|
||||||
let trackContentId = "";
|
let trackContentId = "";
|
||||||
|
|
||||||
if (linkedCaptions) {
|
if (linkedCaptions) {
|
||||||
linkedCaptions.forEach((caption, index) => {
|
for (let index = 0; index < linkedCaptions.length; index += 1) {
|
||||||
if (!captionIndex && captionId.includes(caption.langIso))
|
if (captionLangIso === linkedCaptions[index].langIso) {
|
||||||
captionIndex = index;
|
captionIndex = index;
|
||||||
});
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (captionIndex) {
|
if (captionIndex) {
|
||||||
trackContentId = linkedCaptions[captionIndex].url;
|
trackContentId = linkedCaptions[captionIndex].url;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user