Merge remote-tracking branch 'origin/main'

This commit is contained in:
Andrea Vos 2024-01-11 20:31:33 +01:00
commit 571815e955
3 changed files with 6 additions and 5 deletions

View File

@ -8,6 +8,8 @@
<script>
import { Base64 } from 'js-base64';
export default {
props: {
pronunciation: { default: null, type: String },
@ -15,7 +17,7 @@ export default {
},
computed: {
pronunciationLink() {
return `/api/pronounce/${this.voice}/${encodeURIComponent(this.pronunciation)}`;
return `/api/pronounce/${this.voice}/${Base64.encodeURI(this.pronunciation)}`;
},
name() {
let voices;

View File

@ -112,11 +112,9 @@
</p>
<OpinionListInput v-model="names" :prototype="{ value: '', opinion: 'meh', pronunciation: null }"
:customOpinions="opinions" :maxitems="128" :maxlength="config.profile.longNames ? 255 : 32">
<!--
<template v-slot:additional="s">
<PronunciationInput v-model="s.val.pronunciation"/>
</template>
-->
</OpinionListInput>
<InlineMarkdownInstructions v-model="markdown"/>
<PropagateCheckbox field="names" :before="beforeChanges.names" :after="names" v-if="otherProfiles > 0" @change="propagateChanged"/>

View File

@ -1,6 +1,7 @@
import { Router } from 'express';
import sha1 from 'sha1';
import { convertPronunciationStringToSsml, handleErrorAsync } from '../../src/helpers.js';
import { Base64 } from 'js-base64';
import awsConfig from '../aws.js';
import Polly from 'aws-sdk/clients/polly.js';
@ -8,8 +9,8 @@ import S3 from 'aws-sdk/clients/s3.js';
const router = Router();
router.get('/pronounce/:voice/*', handleErrorAsync(async (req, res) => {
const text = req.params[0];
router.get('/pronounce/:voice/:pronunciation', handleErrorAsync(async (req, res) => {
const text = Base64.decode(req.params.pronunciation);
if (!text || text.length > 256) {
return res.status(404).json({error: 'Not found'});