style(frontend): apply ultracite 7.12 formatting and lint rules
This commit is contained in:
1 parent
fc4758aa0b
commit
c8e5cff871
109 files changed
+845
-817
No files matched your search
@@ -35,23 +35,23 @@ export function viewerItemsFrom(
|
||||
if (media.length === 0) {
|
||||
return [
|
||||
{
|
||||
messageId,
|
||||
mediaId: null,
|
||||
kind: "",
|
||||
downloaded: false,
|
||||
fileName: null,
|
||||
fileSize: null,
|
||||
kind: "",
|
||||
mediaId: null,
|
||||
messageId,
|
||||
mime: null,
|
||||
},
|
||||
];
|
||||
}
|
||||
return media.map((item) => ({
|
||||
messageId: item.message_id,
|
||||
mediaId: item.id,
|
||||
kind: item.kind,
|
||||
downloaded: item.downloaded,
|
||||
fileName: item.file_name,
|
||||
fileSize: item.file_size,
|
||||
kind: item.kind,
|
||||
mediaId: item.id,
|
||||
messageId: item.message_id,
|
||||
mime: item.mime,
|
||||
}));
|
||||
}
|
||||
@@ -141,21 +141,21 @@ async function resolve(
|
||||
return { state: "missing" };
|
||||
}
|
||||
if (!meta.downloaded) {
|
||||
return { state: "not-downloaded", mediaId: meta.id, kind: meta.kind };
|
||||
return { kind: meta.kind, mediaId: meta.id, state: "not-downloaded" };
|
||||
}
|
||||
const blob = await requestMedia(meta.id);
|
||||
if (blob.state === "ready") {
|
||||
return {
|
||||
state: "ready",
|
||||
mediaId: meta.id,
|
||||
kind: meta.kind,
|
||||
mediaId: meta.id,
|
||||
mime: blob.mime,
|
||||
url: blob.url,
|
||||
state: "ready",
|
||||
transcript: meta.extracted_text,
|
||||
url: blob.url,
|
||||
};
|
||||
}
|
||||
if (blob.state === "not-downloaded") {
|
||||
return { state: "not-downloaded", mediaId: meta.id, kind: meta.kind };
|
||||
return { kind: meta.kind, mediaId: meta.id, state: "not-downloaded" };
|
||||
}
|
||||
return { state: "missing" };
|
||||
}
|
||||
@@ -168,21 +168,21 @@ async function resolveById(media: MediaRef): Promise<InlineMedia> {
|
||||
return { state: "missing" };
|
||||
}
|
||||
if (!media.downloaded) {
|
||||
return { state: "not-downloaded", mediaId: media.id, kind: media.kind };
|
||||
return { kind: media.kind, mediaId: media.id, state: "not-downloaded" };
|
||||
}
|
||||
const blob = await requestMedia(media.id);
|
||||
if (blob.state === "ready") {
|
||||
return {
|
||||
state: "ready",
|
||||
mediaId: media.id,
|
||||
kind: media.kind,
|
||||
mediaId: media.id,
|
||||
mime: blob.mime,
|
||||
url: blob.url,
|
||||
state: "ready",
|
||||
transcript: null,
|
||||
url: blob.url,
|
||||
};
|
||||
}
|
||||
if (blob.state === "not-downloaded") {
|
||||
return { state: "not-downloaded", mediaId: media.id, kind: media.kind };
|
||||
return { kind: media.kind, mediaId: media.id, state: "not-downloaded" };
|
||||
}
|
||||
return { state: "missing" };
|
||||
}
|
||||
@@ -235,9 +235,10 @@ export async function requestTranscription(
|
||||
messageId: number
|
||||
): Promise<string | null> {
|
||||
await transcribeMedia(chatId, messageId);
|
||||
for (let i = 0; i < TRANSCRIBE_TRIES; i++) {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, TRANSCRIBE_DELAY);
|
||||
for (let i = 0; i < TRANSCRIBE_TRIES; i += 1) {
|
||||
// biome-ignore lint/performance/noAwaitInLoops: polling waits between tries on purpose
|
||||
await new Promise((done) => {
|
||||
setTimeout(done, TRANSCRIBE_DELAY);
|
||||
});
|
||||
try {
|
||||
const meta = await getMessageMedia(chatId, messageId);
|
||||
|
||||
Reference in new issue
Block a user