|
|
|
|
@ -225,15 +225,23 @@ registerProvider({
@@ -225,15 +225,23 @@ registerProvider({
|
|
|
|
|
|
|
|
|
|
const subtitleRes = (await get(subtitleApiQuery)).data; |
|
|
|
|
|
|
|
|
|
const mappedCaptions = subtitleRes.list.map((subtitle: any): MWCaption => { |
|
|
|
|
const mappedCaptions = subtitleRes.list.map( |
|
|
|
|
(subtitle: any): MWCaption | null => { |
|
|
|
|
const sub = subtitle; |
|
|
|
|
sub.subtitles = subtitle.subtitles.filter((subFile: any) => { |
|
|
|
|
const extension = subFile.file_path.substring( |
|
|
|
|
sub.file_path.length - 3 |
|
|
|
|
); |
|
|
|
|
return [MWCaptionType.SRT, MWCaptionType.VTT].includes(extension); |
|
|
|
|
}); |
|
|
|
|
return { |
|
|
|
|
needsProxy: true, |
|
|
|
|
langIso: subtitle.language, |
|
|
|
|
url: subtitle.subtitles[0].file_path, |
|
|
|
|
url: sub.subtitles[0].file_path, |
|
|
|
|
type: MWCaptionType.SRT, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
return { |
|
|
|
|
embeds: [], |
|
|
|
|
stream: { |
|
|
|
|
|