fix: deno formatting
This commit is contained in:
parent
f4d15314e4
commit
19cc0f6f17
2 changed files with 20 additions and 13 deletions
|
@ -48,18 +48,18 @@ export async function handleTranscripts(
|
|||
|
||||
const start_ms = createTemporalDuration(line.start_ms).round({
|
||||
largestUnit: "year",
|
||||
// @ts-ignore to be fixed
|
||||
// @ts-ignore to be fixed
|
||||
}).toLocaleString(undefined, timestampFormatOptions);
|
||||
const end_ms = createTemporalDuration(line.end_ms).round({
|
||||
largestUnit: "year",
|
||||
// @ts-ignore to be fixed
|
||||
// @ts-ignore to be fixed
|
||||
}).toLocaleString(undefined, timestampFormatOptions);
|
||||
const timestamp = `${start_ms} --> ${end_ms}`;
|
||||
|
||||
// @ts-ignore to be fixed
|
||||
const text = line.snippet.text.replace(
|
||||
/[&<>\u200E\u200F\u00A0]/g,
|
||||
// @ts-ignore to be fixed
|
||||
// @ts-ignore to be fixed
|
||||
(match) => ESCAPE_SUBSTITUTIONS[match],
|
||||
);
|
||||
|
||||
|
|
|
@ -52,16 +52,23 @@ captionsHandler.get("/:videoId", async (c) => {
|
|||
if (label == undefined && lang == undefined) {
|
||||
const invidiousAvailableCaptionsArr: AvailableCaption[] = [];
|
||||
|
||||
captionsTrackArray.forEach((captions: { name: { simpleText: string | number | boolean; }; languageCode: any; }) => {
|
||||
invidiousAvailableCaptionsArr.push({
|
||||
// @ts-ignore to be fixed
|
||||
label: captions.name.simpleText,
|
||||
languageCode: captions.languageCode,
|
||||
url: `/api/v1/captions/${videoId}?label=${
|
||||
encodeURIComponent(captions.name.simpleText)
|
||||
}`,
|
||||
});
|
||||
});
|
||||
captionsTrackArray.forEach(
|
||||
(
|
||||
captions: {
|
||||
name: { simpleText: string | number | boolean };
|
||||
languageCode: any;
|
||||
},
|
||||
) => {
|
||||
invidiousAvailableCaptionsArr.push({
|
||||
// @ts-ignore to be fixed
|
||||
label: captions.name.simpleText,
|
||||
languageCode: captions.languageCode,
|
||||
url: `/api/v1/captions/${videoId}?label=${
|
||||
encodeURIComponent(captions.name.simpleText)
|
||||
}`,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
return c.json({ captions: invidiousAvailableCaptionsArr });
|
||||
}
|
||||
|
|
Reference in a new issue