diff --git a/packages/backend/src/server/api/endpoints/notes/tts.ts b/packages/backend/src/server/api/endpoints/notes/tts.ts index e214a675a3..945100e4bb 100644 --- a/packages/backend/src/server/api/endpoints/notes/tts.ts +++ b/packages/backend/src/server/api/endpoints/notes/tts.ts @@ -66,6 +66,7 @@ export default class extends Endpoint { // eslint- private httpRequestService: HttpRequestService, private roleService: RoleService, ) { + // @ts-ignore super(meta, paramDef, async (ps, me) => { const policies = await this.roleService.getUserPolicies(me.id); if (!policies.canUseTTS) { @@ -82,7 +83,7 @@ export default class extends Endpoint { // eslint- } if (note.text == null) { - return; + throw new ApiError(meta.errors.cannotConvertInvisibleNote); } const instance = await this.metaService.fetch(); @@ -160,6 +161,7 @@ export default class extends Endpoint { // eslint- const contentType = res.headers.get('Content-Type') || 'application/octet-stream'; if (contentType === 'audio/x-wav') { + // @ts-ignore return res.body; } else { throw new ApiError(meta.errors.unavailable); @@ -186,6 +188,7 @@ export default class extends Endpoint { // eslint- const contentType = res.headers.get('Content-Type') || 'application/octet-stream'; if (contentType === 'audio/flac') { + // @ts-ignore return res.body; } else { throw new ApiError(meta.errors.unavailable); diff --git a/packages/frontend/src/pages/admin/external-services.vue b/packages/frontend/src/pages/admin/external-services.vue index 780cb2a077..a996cdc3f2 100644 --- a/packages/frontend/src/pages/admin/external-services.vue +++ b/packages/frontend/src/pages/admin/external-services.vue @@ -132,24 +132,23 @@ const hfnrm = ref(false); const hfSpeedRate = ref(125); const hfdas = ref(false); - async function init() { const meta = await misskeyApi('admin/meta'); deeplAuthKey.value = meta.deeplAuthKey; deeplIsPro.value = meta.deeplIsPro; hfAuthKey.value = meta.hfAuthkey; - hfSpace.value = meta.hfSpace, - hfSpaceName.value = meta.hfSpaceName, - hfexampleAudioURL.value = meta.hfexampleAudioURL, - hfexampleText.value = meta.hfexampleText, - hfexampleLang.value = meta.hfexampleLang, - hfslice.value = meta.hfslice, - hftopK.value = meta.hftopK, - hftopP.value = meta.hftopP, - hfTemperature.value = meta.hfTemperature, - hfnrm.value = meta.hfnrm, - hfSpeedRate.value = meta.hfSpeedRate, - hfdas.value = meta.hfdas + hfSpace.value = meta.hfSpace; + hfSpaceName.value = meta.hfSpaceName; + hfexampleAudioURL.value = meta.hfexampleAudioURL; + hfexampleText.value = meta.hfexampleText; + hfexampleLang.value = meta.hfexampleLang; + hfslice.value = meta.hfslice; + hftopK.value = meta.hftopK; + hftopP.value = meta.hftopP; + hfTemperature.value = meta.hfTemperature; + hfnrm.value = meta.hfnrm; + hfSpeedRate.value = meta.hfSpeedRate; + hfdas.value = meta.hfdas; } function save_deepl() { diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index db6970aa6a..f11eaa4d1d 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -324,7 +324,7 @@ export function getNoteMenu(props: { } else { console.error('Response body is not a ReadableStream'); } - } catch (e) { + } catch (errors) { console.error('Failed to create Blob or Object URL:', e); }