chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-01-09 19:46:32 +04:00
parent f4d99135e4
commit 636ba171a4
64 changed files with 245 additions and 109 deletions
@@ -386,10 +386,7 @@
clearInterval(getVoicesLoop);
const voiceId = getVoiceId();
const voice =
voices
?.filter((v) => v.voiceURI === voiceId)
?.at(0) ?? undefined;
const voice = voices?.filter((v) => v.voiceURI === voiceId)?.at(0) ?? undefined;
currentUtterance = new SpeechSynthesisUtterance(content);
currentUtterance.rate = $settings.audio?.tts?.playbackRate ?? 1;
@@ -494,14 +491,12 @@
audioCache.set(content, new Audio(url));
}
} else if ($config.audio.tts.engine !== '') {
const res = await synthesizeOpenAISpeech(
localStorage.token,
getVoiceId(),
content
).catch((error) => {
console.error(error);
return null;
});
const res = await synthesizeOpenAISpeech(localStorage.token, getVoiceId(), content).catch(
(error) => {
console.error(error);
return null;
}
);
if (res) {
const blob = await res.blob();
@@ -55,11 +55,23 @@
<HtmlToken {id} {token} {onSourceClick} />
{:else if token.type === 'link'}
{#if token.tokens}
<a href={token.href} target="_blank" rel="nofollow" title={token.title} on:click={(e) => handleLinkClick(e, token.href)}>
<a
href={token.href}
target="_blank"
rel="nofollow"
title={token.title}
on:click={(e) => handleLinkClick(e, token.href)}
>
<svelte:self id={`${id}-a`} tokens={token.tokens} {onSourceClick} {done} />
</a>
{:else}
<a href={token.href} target="_blank" rel="nofollow" title={token.title} on:click={(e) => handleLinkClick(e, token.href)}>{token.text}</a>
<a
href={token.href}
target="_blank"
rel="nofollow"
title={token.title}
on:click={(e) => handleLinkClick(e, token.href)}>{token.text}</a
>
{/if}
{:else if token.type === 'image'}
<Image src={token.href} alt={token.text} />
@@ -228,10 +228,7 @@
clearInterval(getVoicesLoop);
const voiceId = getVoiceId();
const voice =
voices
?.filter((v) => v.voiceURI === voiceId)
?.at(0) ?? undefined;
const voice = voices?.filter((v) => v.voiceURI === voiceId)?.at(0) ?? undefined;
console.log(voice);
@@ -312,17 +309,15 @@
}
} else {
for (const [idx, sentence] of messageContentParts.entries()) {
const res = await synthesizeOpenAISpeech(
localStorage.token,
voiceId,
sentence
).catch((error) => {
console.error(error);
toast.error(`${error}`);
const res = await synthesizeOpenAISpeech(localStorage.token, voiceId, sentence).catch(
(error) => {
console.error(error);
toast.error(`${error}`);
speaking = false;
loadingSpeech = false;
});
speaking = false;
loadingSpeech = false;
}
);
if (res && speaking) {
const blob = await res.blob();
@@ -336,7 +331,6 @@
}
};
let preprocessedDetailsCache = [];
function preprocessForEditing(content: string): string {