fix: deno formatting

This commit is contained in:
Emilien 2025-03-08 23:44:13 +01:00
parent f4d15314e4
commit 19cc0f6f17
2 changed files with 20 additions and 13 deletions

View file

@ -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],
);

View file

@ -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 });
}